带有以前获取参数的HTML表单GET方法 [英] HTML Form GET method with previous get parameters
问题描述
我在页面上使用get参数获取表单:
index.php?PageID = 12
我的问题是当表单发布Get时覆盖其他get参数。
我可以使用帖子,但是只能在提交下一个表单时删除帖子值; \\ b
$ b
这个想法就是这些表单建立一个地址;
-
?PageID = 12 $ c $
?PageID = 12& Section = 48
?PageID = 12& Section = 48& Event = 1456
等等more items。
感谢您的帮助。
使用 method = get
时,会忽略在 action
属性中指定的查询字符串参数。添加隐藏表单域等参数:
< form action =index.phpmethod =get>
< input type =hiddenname =PageIDvalue =12>
< input type =hiddenname =Sectionvalue =48>
< input type =hiddenname =Eventvalue =1456>
< / form>
您可以使用服务器端脚本或JavaScript将查询字符串参数添加为隐藏的表单字段。 / p>
I have a form on a page with get parameters:
index.php?PageID=12
I then have a multiple forms on that page which build up the page details as the user selects the details.
My problem is when the form is posted the Get overwrites other get parameters.
I can use post but then can only post the information back once as the post values are wiped when the next form is submitted;
the idea is the forms build up a address as such;
?PageID=12
?PageID=12&Section=48
?PageID=12&Section=48&Event=1456
and so on as the user selects more items.
Thanks for your help.
For forms with method=get
the query string parameters specified in action
attribute are ignored. Add such parameters as hidden form fields:
<form action="index.php" method="get">
<input type="hidden" name="PageID" value="12">
<input type="hidden" name="Section" value="48">
<input type="hidden" name="Event" value="1456">
</form>
You can use server-side script or JavaScript to add the query string parameters as hidden form fields.
这篇关于带有以前获取参数的HTML表单GET方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!