这是我的UI我想在单击+
按钮时更新字段:
我想用flask制作一个类似google表单的应用程序,我创建了一个输入类型来添加一个新的表单字段(目前不是表单字段)。我想在点击输入时更新字段的编号。在
当我点击输入时,我正在发送一个post请求。如果我正在更新我的域,那么我正在检查我的域。但它只更新了一次。在
{cd2}
class Abform(FlaskForm):
name = StringField('Name', validators=[DataRequired(), Length(min=2, max=20)])
count = IntegerField('Count',default=1)
submit = SubmitField('Submit')
@app.route("/home",methods=['POST','GET'])
def home():
form=Abform()
if request.method=='POST':
form.count.data+=1
list_type= ['int', 'string', 'text', 'boolean']
return render_template('home.html', list_type=list_type,form=form)
home.html
我希望当我点击按钮(输入类型),这是HTML文件的第二行,我得到另一个字段。在
目前没有回答
相关问题 更多 >
编程相关推荐