Is there any way to persuade it to do what was intended, to submit the
actual VALUE of the button rather than its caption?
Is there any HTML proposal to add add an extra parameter to the <SUBMIT>
control (something like USEVALUE) so that IE would have to implement it
properly, and we could write sensible CGI scripts?
--
Steve Swift
http://www.swiftys.org.uk/swifty.html
http://www.ringers.org.uk
> Faced with:
><BUTTON NAME=ORDER VALUE=1 TYPE=SUBMIT>Order</BUTTON>
> Internet explorer sends "ORDER=Order" rather than "ORDER=1".
>
> Is there any way to persuade it to do what was intended, to submit the
> actual VALUE of the button rather than its caption?
>
> Is there any HTML proposal to add add an extra parameter to the
<SUBMIT>
> control (something like USEVALUE) so that IE would have to implement
it
> properly, and we could write sensible CGI scripts?
>
It's a known bug in IE. The only thing you could do is use javascript,
but then you could still have a user with js turned off submit an
incorrect value.
You could assign a name attribute to input type="submit", eg: <input
type="submit" name="1" value="Submit"> or you could put the value in a
type="hidden" input element.
--
Adrienne Boswell at Home
Arbpen Web Site Design Services
http://www.cavalcade-of-coding.info
Please respond to the group so others can share
> Gazing into my crystal ball I observed Steve Swift
><Steve....@gmail.com> writing in news:475c...@news.greennet.net:
>
>> Faced with:
>><BUTTON NAME=ORDER VALUE=1 TYPE=SUBMIT>Order</BUTTON>
>> Internet explorer sends "ORDER=Order" rather than "ORDER=1".
>>
>> Is there any way to persuade it to do what was intended, to submit
the
>> actual VALUE of the button rather than its caption?
>>
>> Is there any HTML proposal to add add an extra parameter to the
><SUBMIT>
>> control (something like USEVALUE) so that IE would have to implement
> it
>> properly, and we could write sensible CGI scripts?
>>
>
> It's a known bug in IE. The only thing you could do is use
javascript,
> but then you could still have a user with js turned off submit an
> incorrect value.
>
> You could assign a name attribute to input type="submit", eg: <input
> type="submit" name="1" value="Submit"> or you could put the value in a
> type="hidden" input element.
>
In addition:
http://msdn2.microsoft.com/en-us/library/ms535211.aspx and
<input name="order" type="submit" value="Order">
Perl:
$order=param('order') eq 'Order' ? 1 : 0;
What makes you hope that MS will "come on board" any time soon?
--
Take care,
Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
From MSDN:
"Specifies a container for rich HTML that is rendered as a button. ...
When the BUTTON element is submitted in a form, the innerText value is
submitted"
So not a bug but intentionally programmed behavior: reminds the event
model for Java 1.x buttons - maybe it was made this way to make the
integration seamless (that was the time of the short "big Microsoft+Sun
+Java" companionship"). I do not expect it being fixed until the last
compatibility insurance expired for corporate customers, so at least
until the year 2015.
See also: http://msdn2.microsoft.com/en-us/library/ms535211.aspx
Unfortunately other browsers follow W3's recommendation
www.w3.org/TR/html4/interact/forms.html#edef-BUTTON
"<!ELEMENT BUTTON - -
(%flow;)* -(A|%formctrl;|FORM|FIELDSET)
-- push button -->
<!ATTLIST BUTTON
%attrs; -- %coreattrs, %i18n, %events --
name CDATA #IMPLIED
value CDATA #IMPLIED -- sent to server when submitted
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
and send the value parameter to the server and not the innerText. MS's
"different drummer" attitude can be a PITA in many areas...
Wow! They even have the gall to document that it works incorrectly.
My form has a couple of INPUT TYPE=TEXT fields and several INPUT
TYPE=SUBMIT buttons, so I need both the name and the value to make sense
of which button the user pressed. In most cases I can encode both the
name and the value in just the name, as in NAME="DELETE.document_1.txt"
and that gives me a consistent interface for my CGI scripts across
browsers. It's a little cumbersome though.
Thanks for the information.
> Faced with:
> <BUTTON NAME=ORDER VALUE=1 TYPE=SUBMIT>Order</BUTTON>
> Internet explorer sends "ORDER=Order" rather than "ORDER=1".
And it gets even weirder if the <button> element's content has some
markup. Who would have guessed that the content with all the markup gets
sent?
> Is there any way to persuade it to do what was intended, to submit the
> actual VALUE of the button rather than its caption?
Not really. Of course you could upgrade the construct to a nice normal
submit button
<input type="submit" name="ORDER" value="1">
but even this isn't really safe, really. Sorry. Please don't shoot the
messenger.
> Is there any HTML proposal to add add an extra parameter to the
> <SUBMIT> control (something like USEVALUE) so that IE would have to
> implement it properly, and we could write sensible CGI scripts?
They decided to break the rules seriously when implementing <button> in
IE, so why would they care about new rules any more?
The reason why even
<input type="submit" name="ORDER" value="1">
isn't really safe is that in most cases, you have at least one text
input field in the form. Now, what happens when the user hits Enter in
that field? The specifications are unclear. Common browser behavior
seems to be that the form data is submitted as if the _first_ submit
button were used, but would you really rely on this?
The safe approach is to have a single submit button (or several submit
buttons with the same function, for convenience, in some cases). This
means that you would use radio buttons or checkboxes to select the
action to be carried out. Granted, this means that often the user needs
to click twice (radio button and submit button) instead of clicking
once, but on balance, the single click takes more time since the user
has to select between alternatives.
(If you use radio buttons that way, make sure one of them is
preselected, with checked="checked", normally a neutral one indicating
no action. This is an additional measure against unintended actions.)
--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/
Several hours later I got to pondering: I wonder if any one at all finds
the inner html useful when returned where the VALUE= should be expected?
Even amongst web developers at Microsoft.
I cannot see any use, considering having to use VALUE attribute in order
to change the caption of <INPUT TYPE='submit'> is normally undesirable.
Ask them. I can only imagine the response.
innerHTML is a Microsoft invention thus a non-standard attribute, so I'd
say not. Other browsers do support it (out of necessity, I imagine), but
avoid it if there is a standards way to get the info.
--
Berg
InnerHTML is a concept that I've managed without so far. In the context
of <BUTTON>, I just assumed that it was the "stuff" between the <BUTTON>
and the </BUTTON>, since that is what I get in my CGI scripts.