473,789 Members | 2,500 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

<button type=submit...> and <input type=submit ...>


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******@liber o.it>
http://www.chiacchierando.com/

Jul 20 '05 #1
15 28958
Mattia <ma******@liber o.it> wrote:
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?


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

Jul 20 '05 #2
On Mon, 10 Nov 2003 00:48:35 +0000 (UTC), in
comp.infosystem s.www.authoring.html, Jukka K. Korpela wrote:
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
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?

Why do you postulate that javascript could help here?


Because it does.
My same problem, on this same newsgroup:

http://tinylink.com/?CwT8jobe3S or
msg-id <sl************ *******@choam.e frei.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.


If you can, yes, that's even better :)

--
++++++++ Zelda, Dragon Ball, Mana and my (art)work at www.salagir.com ++++++++
Jul 20 '05 #3
Salagir <Sa*****@jeruCI TEDELESPACE.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.
Why do you postulate that javascript could help here?


Because it does.


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.
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 :)


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

Jul 20 '05 #4
On Mon, 10 Nov 2003 11:19:10 +0000 (UTC), in
comp.infosystem s.www.authoring.html, Jukka K. Korpela wrote:
Salagir <Sa*****@jeruCI TEDELESPACE.org .invalid> wrote:
The specifications aren't absolutely crystal clear either 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.


Of course, by saying "if clicked" I meant "if the form was submitted
using the specific button created by this tag" ;)
You seem to have a rather
simplistic view on the situation - that's why it looks clear to you.


Yes, but isn't html simple ? ;) That's why it works.
Why do you postulate that javascript could help here?

Because it does.

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.


In what follows, I use javascript only with IE, considering that the
others browsers... respect w3c. And I don't consider IE users as people
bright enought to disable javascript. I they are, they're bright enought
to use a real browser.
If you can, yes, that's even better :)

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?


Well, I don't know exactly what he intends to do.

Plus, button can make nice things like puttings images and html text in
it.. and I think it's cool, sorry ;)

--
++++++++ Zelda, Dragon Ball, Mana and my (art)work at www.salagir.com ++++++++
Hi! Je voudrais une crêpe au chocolat fruits de mer, s'il vous plait!
Jul 20 '05 #5
On Mon, 10 Nov 2003, Salagir wrote:
On Mon, 10 Nov 2003 00:48:35 +0000 (UTC), in
comp.infosystem s.www.authoring.html, Jukka K. Korpela wrote:
Why do you postulate that javascript could help here?
Because it does.


You can't have been reading this group for long! In a WWW context,
it's a mistake to make Javascript a mandatory part of any solution.

Optional extras are a different matter, but that doesn't seem to be
what we have here.

My reaction to your posting was that you already had a competent
solution, and now seemed to be looking for a way to break it.
I use javascript for IE and buttons for the others


Not on my IE, you won't. When Billware alerts me with the ominous
alert message "Scripts are usually safe", I read that as "scripts are
sometimes disastrous - would I want to run scripts from a site that
has, as yet, given me no reason to trust it?".
Jul 20 '05 #6
On Mon, 10 Nov 2003 11:00:42 +0000, in comp.infosystem s.www.authoring.html,
Alan J. Flavell wrote:
I use javascript for IE and buttons for the others

Not on my IE, you won't. When Billware alerts me with the ominous
alert message "Scripts are usually safe", I read that as "scripts are
sometimes disastrous - would I want to run scripts from a site that
has, as yet, given me no reason to trust it?".


Why do you use this "biggest spyware and security hole usable" for a
browser then ?
I enable javascript with firebird and was never bothered by any pop-up
and others. For some little details, javascript can be usefull, and if
there is a real problem, I disable javascript with one click.

(omg did I just begin a troll??)
--
++++++++ Zelda, Dragon Ball, Mana and my (art)work at www.salagir.com ++++++++
<\slick> 3d studio max install told me to close all program when
installing, so i just opened more to be defiant
<\slick> take that
Jul 20 '05 #7
On Mon, 10 Nov 2003, Salagir wrote:
On Mon, 10 Nov 2003 11:00:42 +0000, in comp.infosystem s.www.authoring.html,
Alan J. Flavell wrote:
I use javascript for IE and buttons for the others Not on my IE, you won't. When Billware alerts me with the ominous
alert message "Scripts are usually safe", I read that as "scripts are
sometimes disastrous - would I want to run scripts from a site that
has, as yet, given me no reason to trust it?".


Why do you use this "biggest spyware and security hole usable" for a
browser then ?


OK: normally, I use Mozilla. Sometimes I need to use IE. I chose to
present the IE scenario since it's closer to what (statistically)
most users would be starting from. After all, this isn't supposed to
be about me, alone, personally, but about j.random.cautio us.webnaut.
We don't, of course, know what security settings they choose, but
after a few trojan infections and OS re-installations they might start
to get some kind of message.

Both of those browsers have options to disable scripting. Indeed,
every browser has an option to disable scripting: just stick it behind
an appropriate proxy.
I enable javascript with firebird and was never bothered by any pop-up
Oh, I enabled those warnings quite deliberately by choice. I _want_
to be bothered when someone's trying to execute untrusted code on my
computer.
and others. For some little details, javascript can be usefull,


You seem to have overlooked the fact that this is an _authoring_
discussion group, and what's more, in a *WWW* context. You don't get
anywhere by arguing with users as to whether they are going to allow
you to execute your javascript on their computer. You do better to
adapt your authoring so that they get the substantive part of your
content.
Jul 20 '05 #8
thanks Salagir!
Well, I don't know exactly what he intends to do.


I will do what Salagir sugested to do!
The problem was: I had a working form with <input type="submit" ..> and
wanted to improve the look of it by substituting it with a <button> tag,
because in a <button> tag you can insert formatted text, images...

Salagir gave me a solution, Jukka gave me nothing.

Jukka, i know that rich text, images and javascript hurt your soul of
"pure HTML" programmer. I know you want everything to be plain text, but
that's now what I want, that's not what my customers want, that's not
what my boss wants. Maybe they're all stupid,
but this is the way the world goes.

Thank you for all the information.

--
Mattia <ma******@liber o.it>
http://www.chiacchierando.com/

Jul 20 '05 #9
Mattia <ma******@liber o.it> wrote:
Salagir gave me a solution, Jukka gave me nothing.
I cannot give you the right answer, if you are not willing to receive it.
(We note, en passant, that you don't post the URL of your purported solution
[i.e., a non-solution to a non-problem].)
Jukka, i know that rich text, images and javascript hurt your soul of
"pure HTML" programmer.


We are not on a first name basis, but thanks anyway for telling that you
don't even know what HTML is. Please do not stop using your current
malformed From field until you have something to say about HTML authoring
for the World Wide Web.

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html

Jul 20 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
2822
by: Fred Phase | last post by:
The following button definition works fine in Mozilla where the value "in" is assigned to "awol_status". In Internet Explorer 6.0.2800.1106 on Win 2K the value "switch status" is assigned to "awol_status". This is not what I want :-( <button type="submit" name="awol_status" value="in">switch status</button> I have searched Google for this issue and I read of this being a problem in IE 4 but in IE5 the value="" attribute would be used
3
9602
by: phil_gg04 | last post by:
Dear All, I am trying to influence the font size for a <button> element using CSS, but failing for IE. Works ok in FF. IE seems to ignore all attempts; for example with this: div.whatever button { width: 8em; font-size: something; }
3
13159
by: TR | last post by:
Is it possible with CSS to prevent this wrapping alignment with a checkbox with a nested label? This is the label of the checkbox that wraps beneath it I'd prefer it looked like this, with a flush left margin:
2
2613
by: Christopher Benson-Manica | last post by:
According to http://www.w3schools.com/tags/tag_button.asp, the type attribute of the <button> tag is optional. Is the UA at liberty to choose any type it wishes if the attribute is omitted? Does the presence or lack of a DTD impact the answer? -- Christopher Benson-Manica | I *should* know what I'm talking about - if I ataru(at)cyberspace.org | don't, I need to know. Flames welcome.
2
10971
by: Steve Wilkinson | last post by:
I've just started using managed C++ with VS2005, so please forgive my ignorance. I'm investigating producing a managed wrapper for some functionality of the Windows Media Format SDK. I have the following very simple header and class files: Header File: // CSJ.h
8
5682
by: Rainer Queck | last post by:
Hi NG, I have a base class "Telegram". This class , as well as all descants have a static public field "public static int TelegramNo = <a tlg no>;" Now I added all descants of Telegram to a generic List<Type>: List<Type> tlgList = new List<Type>(); TlgList.Add(typeof(Telegram1));
1
2984
by: =?Utf-8?B?RnJhbmNvaXNWaWxqb2Vu?= | last post by:
Hi there, Does anybody know how to return the results of an IEnumerable<typeas an array of the same type i.e type in a web service call without first having to collect all elements in the IEnumerable<typeand storing it in memory first? This question is really about optimizing large collections of data returned by web services. If it is possible to loop through the IEnumerable<type> with a "foreach" and somehow start formatting the...
2
3388
by: Richard Maher | last post by:
Hi, I'm trying to use the Visibility Style attribute for a Div to effectively PopUp a lightweight window with some additional context-sensitive information, when a user mouses over a given field(s). The popping-up seems to work just fine; it's the tearing down that's giving me grief. If I stick a onmouseout event on the same input field that caused the onmouseover/pop-up, it starts to flicker 'cos the <divis placed for esthetically...
1
10278
by: lovecreatesbea... | last post by:
In the following function `HardwareStatusDb()', If its arguments are declared as type of `string', I get: main.cpp:5: error: expected initializer before ‘int’. The error disappears when those arguments are declared as type of `string &'. Why am I getting this error?
5
11155
by: Ronald S. Cook | last post by:
From my business tier (class) I get back an IQueryable<Penof data. Here is my client code that works fine: PenClass penClass = new PenClass(); IQueryable<Penpens = penClass.SelectPens(); However, I want to then select a subset of this data from within the client. I tried this: IQueryable<PenpensSubset = from p in pens select p.PenId, p.PenNumber;
0
9511
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10404
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10195
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9979
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9016
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7525
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6765
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5548
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3695
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.