< button type = submit ...>和< input type = submit ...> [英] <button type=submit...> and <input type=submit ...>
问题描述
嗨!
我有< form>可以提交thruogh三个按钮,我需要
告诉女巫一个人在提交表单时被按下了。我现在这样做
,其中3< input type =" submit"命名= QUOT; ..." value =" ...">
with< input type =" submit" ...>提交的唯一名称 - 值$
(推入查询字符串)是推送按钮的一个按钮(如果你有很多)。
Ex:
< form ...>
< input type =" text" ... />
< input type =" submit"命名= QUOT; A" value =" click" ... />
< input type =" submit"名称= QUOT; B" value =" click2" ... />
< input type =" submit"名称= QUOT; C" value =" click3" ... />
< / form>
这样的形式我可以轻松区分使用了什么按钮to
提交表格后提交。
但是< button type =" submit"命名= QUOT; ..." ....>点击! < /按钮>所有
提交name-innertext值(推送到查询字符串)
Ex:
< form .. 。>
< input type =" text" ... />
< button type =" submit"命名= QUOT; A">点击< / button>
< button type =" submit"名称= QUOT; B"> click2< / button>
< button type =" submit"名称= QUOT; C"> click3< / button>
< / form>
我有哪些方法来区分用于提交的按钮
$提交后b $ b表格?
有没有办法不使用javascript进行操作?
-
Mattia< ; ma ****** @ libero.it>
http:// www。 chiacchierando.com/
Hi!
I have a <form> that can be submitted thruogh three buttons and I need
to tell witch one was pressed when the form was submitted. I now do it
with 3 <input type="submit" name="..." value="...">
with <input type="submit" ...> the only name-value values submitted
(pushed into the query string) is the one of the submit button that was
pushed (if you have many of them).
Ex:
<form ...>
<input type="text" .../>
<input type="submit" name="a" value="click".../>
<input type="submit" name="b" value="click2".../>
<input type="submit" name="c" value="click3".../>
</form>
in a form like this I can easily distinguish what button was used to
submit the form AFTER SUBMITTING.
but with <button type="submit" name="..." .... > click! </button> all
the name-innertext values are submitted (pushed to the query string)
Ex:
<form ...>
<input type="text" .../>
<button type="submit" name="a"> click </button>
<button type="submit" name="b"> click2 </button>
<button type="submit" name="c"> click3 </button>
</form>
What ways do I have to distinguish what button was used to submit the
form AFTER SUBMITTING?
Is there a way to do it without using javascript?
--
Mattia <ma******@libero.it>
http://www.chiacchierando.com/
推荐答案
Mattia< ma ****** @ libero.it>写道:
Mattia <ma******@libero.it> wrote:
我有一个< form>可以提交thruogh三个按钮,我需要
告诉女巫一个被提交表格时被按下。我现在用3< input type =" submit"来做它
命名= QUOT; ..."值= QUOT; ...">
罚款。
< input type =" submit"命名= QUOT; A" value =" click" ... />
< input type =" submit"名称= QUOT; B" value =" click2" ... />
< input type =" submit"名称= QUOT; C" value =" click3" ... />
< / form>
以这样的形式我可以轻松区分用于提交表单的按钮提交后。
确实如此。通过使用不同的名称属性
_和_不同的值属性,您已经确定了它。 (其中任何一个都足够了。)用户
可能难以理解提交点击,点击2,
和点击3的意思。 :-)
但是< button type =" submit"命名= QUOT; ..." ....>点击! < /按钮>所有
name-innertext值都被提交(推送到查询字符串)
已知浏览器在此区域行为不端。这些规格也不是很明显 - 这些元素真的是提交按钮吗?
我有什么方法可以区分用于提交的按钮提交后的形式是什么?
有没有办法不使用javascript来实现?
I have a <form> that can be submitted thruogh three buttons and I need
to tell witch one was pressed when the form was submitted. I now do it
with 3 <input type="submit" name="..." value="...">
Fine.
<input type="submit" name="a" value="click".../>
<input type="submit" name="b" value="click2".../>
<input type="submit" name="c" value="click3".../>
</form>
in a form like this I can easily distinguish what button was used to
submit the form AFTER SUBMITTING.
Yes indeed. You have made it double sure by using different name attributes
_and_ different value attributes. (Either of them would suffice.) The user
may have difficulties in understanding BEFORE SUBMITTING what click, click2,
and click3 mean. :-)
but with <button type="submit" name="..." .... > click! </button> all
the name-innertext values are submitted (pushed to the query string)
Browsers are known to misbehave in this area. The specifications aren''t
absolutely crystal clear either - are such elements really "submit buttons"?
What ways do I have to distinguish what button was used to submit the
form AFTER SUBMITTING?
Is there a way to do it without using javascript?
为什么你假设这个javascript可以帮到这里吗?
无论如何,你描述的是你现在有一个可行的解决方案。坚持下去,
并且切换到< button>不会产生问题。很简单。
-
Yucca, http://www.cs.tut.fi/~jkorpela/
有关网页制作的网页: http://www.cs.tut.fi/~jkorpela/www.html br />
Why do you postulate that javascript could help here?
Anyway, you describe that you now have a working solution. Just stick to it,
and don''t create problems by switching to <button>. Simple as that.
--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html
2003年11月10日星期一00:48:35 +0000(UTC),
comp.infosystems。 www.authoring.html ,Jukka K. Korpela写道:
On Mon, 10 Nov 2003 00:48:35 +0000 (UTC), in
comp.infosystems.www.authoring.html, Jukka K. Korpela wrote:
在这样的形式中,我可以很容易地区分用什么按钮来提交提交后的表格。
但是< button type =" submit"命名= QUOT; ..." ....>点击! < /按钮>所有
name-innertext值都被提交(推送到查询字符串)已知浏览器在这个区域行为不端。规格也不是非常清晰 - 这些元素是否真的提交按钮?
in a form like this I can easily distinguish what button was used to
submit the form AFTER SUBMITTING.
but with <button type="submit" name="..." .... > click! </button> all
the name-innertext values are submitted (pushed to the query string) Browsers are known to misbehave in this area. The specifications aren''t
absolutely crystal clear either - are such elements really "submit buttons"?
我认为它们是,而且它是'非常清楚:如果点击就发送一个变量
I think they are and it''s quite clear: just send a variable if clicked
我有什么方法可以区分用什么按钮提交
表格提交后?
有没有办法在不使用javascript的情况下完成?
What ways do I have to distinguish what button was used to submit the
form AFTER SUBMITTING?
Is there a way to do it without using javascript?
为什么你假设javascript可以帮到这里?
Why do you postulate that javascript could help here?
因为它确实如此。
同样的问题,在同一个新闻组:
http://tinylink.com/?CwT8jobe3S 或
msg-id< sl *************** **** @choam.efrei.fr>
我的php解决方案(msg用法语,但php仍然是php):
我使用javascript IE和其他按钮
http://groups.google.com/groups?selm...choam.efrei.fr
或msg-id< sl ******************** @ choam.efrei.fr>
无论如何,你描述了你现在有一个有效的解决方案。坚持下去,
并且不要通过切换到< button>来创建问题。很简单。
Because it does.
My same problem, on this same newsgroup:
http://tinylink.com/?CwT8jobe3S or
msg-id <sl*******************@choam.efrei.fr>
My php solution (msg in french, but php is still php):
I use javascript for IE and buttons for the others
http://groups.google.com/groups?selm...choam.efrei.fr
or msg-id <sl********************@choam.efrei.fr>
Anyway, you describe that you now have a working solution. Just stick to it,
and don''t create problems by switching to <button>. Simple as that.
如果可以的话,那就更好了。
-
+++++++++以及 www.salagir.com +++++++
If you can, yes, that''s even better :)
--
++++++++ Zelda, Dragon Ball, Mana and my (art)work at www.salagir.com ++++++++
Salagir< Sa ***** @ jeruCITEDELESPACE.org.invalid> ;写道:
Salagir <Sa*****@jeruCITEDELESPACE.org.invalid> wrote:
浏览器在这方面行为不端。规格
也不是绝对清晰 - 这些元素真的是提交按钮吗?
Browsers are known to misbehave in this area. The specifications
aren''t absolutely crystal clear either - are such elements really
"submit buttons"?
我认为它们是和它一样的很清楚:如果点击就发送一个变量
I think they are and it''s quite clear: just send a variable if clicked
不,这肯定不是真的。没有要求点击将
是激活元素的唯一可能性。你似乎对这种情况有一个相当简单的看法 - 这就是为什么它看起来很清楚。
No, that''s certainly not true. There is no requirement that clicking would
be the only possibility of activating an element. You seem to have a rather
simplistic view on the situation - that''s why it looks clear to you.
为什么你假设javascript可以帮到这里?
Why do you postulate that javascript could help here?
因为它确实。
Because it does.
当然不能。你显然没有在这个组的上下文中考虑这个问题,这是_World Wide Web_的HTML创作。
假设一个特定的客户端脚本语言是支持
浏览器启用意味着您没有考虑WWW术语。
It cannot, of course. You are apparently not considering the issue within
the context of this group, which is HTML authoring for the _World Wide Web_.
Postulating that a particular client-side scripting language is supported by
the browser and enabled means that you are not thinking in WWW terms.
无论如何,您描述的是现在有一个有效的解决方案只需坚持下去,切换到< button>就不会产生问题。简单如上。
Anyway, you describe that you now have a working solution. Just stick
to it, and don''t create problems by switching to <button>. Simple as
that.
如果可以的话,那就更好了。)
If you can, yes, that''s even better :)
为什么能够做某事呢?确切地说,继续使用一个简单,强大的解决方案需要什么才能获得b / b
将其更改为< button>问题?
-
Yucca, http://www.cs.tut.fi/~jkorpela/
有关网页制作的网页: http://www.cs.tut.fi/~jkorpela/www.html >
Why would it be a matter of being able to do something? Exactly what would
be needed for continuing the use of a simple, robust solution, as opposite
to changing it to a <button> problem?
--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html
这篇关于< button type = submit ...>和< input type = submit ...>的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!