隐藏表单提交按钮值 [英] Hide form submit button value

查看:89
本文介绍了隐藏表单提交按钮值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好。


这是我的示例表格:


< form method =" get" action ="">

< p>

< input type =" radio"名称= QUOT; radio_example" id =" radio1"

value =" radio1_val" />

< label for =" radio1">单选按钮1< / label>

< / p>

< p>

< input type =" radio"名称= QUOT; radio_example" id =" radio2"

value =" radio2_val" />

< label for =" radio2">单选按钮2< / label>

< / p>

< p>

< input type =" submit"名称= QUOT; submitform" id =" submitform"

value =" caption" />

< / p>

< / form>


使用指定的GET方法提交此表单时你会得到一个这样的

网址( http:// foo.bar/form.php 是表单'的URL:
http://foo.bar/form.php?radio_exampl...itform=caption


现在我想避免提交按钮的值也传递给了URL,因此我只会在提交表单时获得此URL:
http://foo.bar/form.php?radio_example=radio1_val


这可能吗?

Hello.

Here''s my example form:

<form method="get" action="">
<p>
<input type="radio" name="radio_example" id="radio1"
value="radio1_val" />
<label for="radio1">radio button one</label>
</p>
<p>
<input type="radio" name="radio_example" id="radio2"
value="radio2_val" />
<label for="radio2">radio button two</label>
</p>
<p>
<input type="submit" name="submitform" id="submitform"
value="caption" />
</p>
</form>

When submitting this form with the specified GET method you''ll get an
URL like this (http://foo.bar/form.php being the form''s URL):
http://foo.bar/form.php?radio_exampl...itform=caption

Now I want to avoid that the submit button''s value is also passed to
the URL, so I would only get this URL when submitting the form:
http://foo.bar/form.php?radio_example=radio1_val

Is this possible?

推荐答案

k3pp0 schreef:
k3pp0 schreef:

Hello。


这是我的示例形式:


< form method =" get" action ="">

< p>

< input type =" radio"名称= QUOT; radio_example" id =" radio1"

value =" radio1_val" />

< label for =" radio1">单选按钮1< / label>

< / p>

< p>

< input type =" radio"名称= QUOT; radio_example" id =" radio2"

value =" radio2_val" />

< label for =" radio2">单选按钮2< / label>

< / p>

< p>

< input type =" submit"名称= QUOT; submitform" id =" submitform"

value =" caption" />

< / p>

< / form>


使用指定的GET方法提交此表单时你会得到一个这样的

网址( http:// foo.bar/form.php 是表单'的URL:
http://foo.bar/form.php?radio_exampl...itform=caption


现在我想避免提交按钮的值也传递给了URL,因此我只会在提交表单时获得此URL:
http://foo.bar/form.php?radio_example=radio1_val


这可能吗?
Hello.

Here''s my example form:

<form method="get" action="">
<p>
<input type="radio" name="radio_example" id="radio1"
value="radio1_val" />
<label for="radio1">radio button one</label>
</p>
<p>
<input type="radio" name="radio_example" id="radio2"
value="radio2_val" />
<label for="radio2">radio button two</label>
</p>
<p>
<input type="submit" name="submitform" id="submitform"
value="caption" />
</p>
</form>

When submitting this form with the specified GET method you''ll get an
URL like this (http://foo.bar/form.php being the form''s URL):
http://foo.bar/form.php?radio_exampl...itform=caption

Now I want to avoid that the submit button''s value is also passed to
the URL, so I would only get this URL when submitting the form:
http://foo.bar/form.php?radio_example=radio1_val

Is this possible?






省略提交按钮的名称。

我认为只是命名formelements实际上是发送的。


我必须添加我看不出有任何理由离开那部分,但是......

就是我。


问候,

Erwin Moller

Hi,

Leave out the name of the submitbutton.
I think only named formelements are actually send.

I must add I cannot see any reason to leave that part out, but well...
that is just me.

Regards,
Erwin Moller


Erwin Molleraécrit:
Erwin Moller a écrit :

我认为实际上只发送了一个名称formelements。
I think only named formelements are actually send.



我确认,加上我补充说它根本不是PHP相关的;)


问候,

-

Guillaume

I confirm, plus I add that it''s not PHP related at all ;)

Regards,
--
Guillaume


4月17日,10:48,Guillaume< ggra ... @ NOSPAM。 gmail.com.INVALIDwrote:
On 17 Apr, 10:48, Guillaume <ggra...@NOSPAM.gmail.com.INVALIDwrote:

Erwin Molleraécrit:我认为实际上只发送了一个名字。


我确认,加上我补充说它根本不是PHP相关的;)


问候,

-

Guillaume
Erwin Moller a écrit :I think only named formelements are actually send.

I confirm, plus I add that it''s not PHP related at all ;)

Regards,
--
Guillaume



嘿Guillaume,那是'Jerry'的工作!

Hey Guillaume, that''s Jerry''s job!


这篇关于隐藏表单提交按钮值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆