File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
Spring in Action
this week in the
IE doesn't return value of submit button?
Joined: Sep 04, 2006
Mar 25, 2007 13:25:00
Here is a form (it is the output of a jsp, but that's irrelevant at this point). This was cut and pasted directly from Internet Explorer's View->Document Source menu:
<form method="post" action="/infoisland/members/servlet/TribeMgr"> <fieldset> <legend>New Tribe </legend> <label for="trbname">Tribe Name (32 chars):</label> <input type="text" name="trbname" class="frmtxt" value="Title goes here" /> <br class=fieldalign /> <label for="trbdesc">Tribe Description</label> <textarea rows="5" cols="32" name="trbdesc" class="leftlabeled">Description goes here</textarea> <br class=fieldalign /> <div class="break"> <p><input type="checkbox" name="mod" class="check" /> Moderated Tribe (all messages screened by the Tribal Chief)</p><br class="fieldalign"> <p><input type="radio" name="access" value="public" >Anyone can join this tribe</p> <p><input type="radio" name="access" value="protected" checked>A member must invite someone to join</p> <p><input type="radio" name="access" value="private" >The chief (currently you) must invite someone to join (a member can request this of the chief)</p> </div> </fieldset> [B]<button type="submit" name="trbbtn" value="trbnew" class="centeredbutton">New Tribe</button>[/B] <br class="fieldalign" /> </form>
Note at the end where I've bolded the button. Here is a fragment of the TrbMgr
this form calls:
String target= ""; String todo= rq.getParameter("trbbtn"); Log.write("\n**********\nTribeMgr: todo= " + todo);
And, here is what the log prints out:
TribeMgr: todo= New Tribe
In other words, IE is sending the text on the button and not the "value='btnvalue'" from the <input> tag.
Mozilla works just fine, and I don't think I've ever seen this. Has anyone else? Is this a quirk in IE I don't know about? I did a google search and haven't found anything so far.
-------<br />Thanks & regards,<br />anw
Author and ninkuma
Joined: Jan 10, 2002
Mar 27, 2007 14:58:00
You've found yet another instance where Internet Explorer does not follow the HTML 4 Specification:
Both IE6 and IE7 exhibit this behavior with your sample code.
[ March 27, 2007: Message edited by: Bear Bibeault ]
Asking smart questions
Books by Bear
I agree. Here's the link:
subject: IE doesn't return value of submit button?
problem when integrating jspell with tinyMCE editor
JSP <a href> tags breaks page functionality
Radio Select and Other
checked radio button from an Enum value
fieldset and form problem
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014