我使用带有action="/sact/${searchp}/"的post GET请求来提交用户搜索查询。 var searchp = search.querySelector("input.search-input").value;
// returns the normal value
document.body.innerHTML += `<form id="jsForm" action="/sact/${search}/" method="GET"><input type="hi
我有一个关于MVC设计和表单提交的问题。当我想要节省资源时,我遇到了一些问题。
例如,我有一个带有给定方法的控制器名vehicle:
vehicle
|-- list
`-- GET - Display the list of vehicle.
|-- add
|-- GET - Display the form for adding a vehicle.
`-- POST - Save the added vehicle.
我的问题是,在用户保存了车辆之后,我想回到显示通知的车辆列表中。view_model.add_notification是在
我有一个接受用户输入的视图,在成功发布后,它会重定向到另一个页面。这与本教程中的代码基本相同:
def quex(request, id, question_number):
next_question = int(question_number) + 1
if request.method == 'POST': # If the form has been submitted...
form = ContactForm(request.POST) # A form bound to the POST data
if form.