Jump to content

IE and <button> tags

Recommended Posts

Hi, I posted something like this b4. But I've gotten a little closer, so I hope someone will be able to get me the 'rest of the way'.So I put together a simple form and I wanted to make it bi-lingual. I can make the labels and fieldset english or spanish (using technique not shown) and then swapping out the english and spanish values of 'Click Here' and 'No Click Here' I can even make the buttons bi-lingual. ('Chasque Aquí' and 'Ningún Chasque Aquí')

<form action="form_results.php" method="post" name="My SignOn" id="My SignOn"><fieldset><legend>My Logon</legend><p><label for="username">Username:</label><br /><input type="text" size="100" maxlength="100" name="username" id="username" tabindex="1" /></p><p><label for="password">Password:</label><br /><input type="password" size="100" maxlength="100" name="password" id="password" tabindex="2" /></p><button type="submit" name="submit" id="submit" value="submit1">Click Here</button><button type="submit" name="submit" id="submit" value="submit2">No Click Here</button></fieldset></form>

In firefox this works great, since it is the 'value' attribute that gets passed(results received in FireFox): ["username"]=> string(13) "Test Username" ["password"]=> string(13) "Test Password" ["submit"]=> string(7) "submit1"Whether the button label was 'Click Here' or 'Chasque Aqui' the "Results" is "submit1".However, with IE, the exact same form renders this results(results received in Internet Exporere): ["username"]=> string(17) "Test Two Username" ["password"]=> string(17) "Test Two Password" ["submit"]=> string(13) "No Click Here"Notice two things:1. The result is the Text between the button tags, not the 'value' attribute of the tag. This is devastating to a PHP application that chooses an action based upon the returned "submit" value that attempts to be bi-lingual.2. Even though I meticulously clicked "Click Here" the form returned as if I actually clicked "No Click Here". So my questions are, how do I separate Button Text from returned Button "submit" value in IE, and how do I get the returned Button "submit" value to differentiate by which button is clicked in IE?Thanks in advance for any assistance -- even links to good sites/tutorials.

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...