0
我有一个页面呈现用户搜索的数据。我希望允许用户随时在页面一侧更改搜索凭据。出于某种原因,它只是为“更换学校”部分工作。为什么代码永远不会到达其他搜索字段(例如,当我更改搜索类型时,没有任何反应,没有任何内容显示到控制台)。请忽略缩进错误,它在粘贴时变得混乱!处理更新的搜索表单
相关HTML:(所有名称/ ID的文本字段匹配在肯定的Python代码)
<form id="update" name="update" method="post" action="/find-it/">
<input type="submit" value="search" id="enter" form="update">
PYTHON:
if request.method == 'POST':
if "updateSchool" in request.form:
print('school changed')
school = request.form['updateSchool']
data = updateSchool(school)
return render_template('testBrowse.html', data=data)
elif "updateType" in request.form:
print('type changed')
newType = request.form['updateType']
data = updateType(newType)
print('getting to update type')
return render_template('testBrowse.html', data=data)
elif "updateTitle" in request.form:
print('title changed')
newTitle request.form['updateTitle']
data = updateTitle(newTitle)
return render_template('testBrowse.html', data=data)
return render_template('testBrowse.html', data=data)
非常感谢! – user3344239