python - flask-wtf中两个SelectField可否实现在后台实现联动呢?如果不能在前台又应该怎么写js代码呢?
高洛峰
高洛峰 2017-04-17 15:55:57
0
1
988
class form(Form):
    select1 = SelectField(u'型号', choices = [(2, '2'), (5, '5')]) 
    select2 = SelectField(u'规格', choices = [(2, '2'), (5, '5')]) 

怎样写代码再能是前端的select实现联动呢?(select1选2,select2也自动选2),求大神指点。。

高洛峰
高洛峰

拥有18年软件开发和IT教学经验。曾任多家上市公司技术总监、架构师、项目经理、高级软件工程师等职务。 网络人气名人讲师,...

reply all(1)
黄舟

1. You need to figure out what WTForms does.
Please refer to http://segmentfault.com/a/1190000002531677

2. For products in B/S mode, the server side only provides the reception, processing and return of data. Browser side, from the client itself.
So according to your description, the effect is to get the result on the B side, and the trigger of this result also comes from the B side itself. Then we can only let JavaScript handle this matter. Since this analysis is implemented, the monitoring, processing, and results of the event are also implemented.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template