Trouble using <button> element in IE (internet Explorer) I've been having trouble using the <button> in IE7. The problem is IE always uses the "TEXT" between the <button name="action" value="thevalue" >TEXT</button> as the return value from a form POST, instead of "thevalue".
As I observed this only happens in IE6/7 but not on Firefox and Chrome. I've tried to Google for a work around but I usually get solutions using JavaScript... which I also prefer not to use.
Instead, I used the following to get around the issue:
<button name="action[thevalue]" >TEXT</button>
when submitted the result array will be like this:
Array ( [action] => Array ( [thevalue] => TEXT ))
having the array structure above, all I need to do is to get the "thevalue" key of the variable array "action". Here's how I did it in PHP:
That's all to it... well I hope I have given you another option on how to go around the subject. Feel free to use the code above, and if you find it useful, I would greatly appriace if you atleast provide a feedback via comment.
Comment
you guys can also try this approach :)http://thespotontheweb.blogspot.com/2009/04/trouble-using-element-in-ie7.html :
Trouble using <button> element in IE (internet Explorer)
I've been having trouble using the <button> in IE7. The problem is IE always uses the "TEXT" between the <button name="action" value="thevalue" >TEXT</button> as the return value from a form POST, instead of "thevalue".
As I observed this only happens in IE6/7 but not on Firefox and Chrome. I've tried to Google for a work around but I usually get solutions using JavaScript... which I also prefer not to use.
Instead, I used the following to get around the issue:
<button name="action[thevalue]" >TEXT</button>
when submitted the result array will be like this:
Array ( [action] => Array ( [thevalue] => TEXT ))
having the array structure above, all I need to do is to get the "thevalue" key of the variable array "action". Here's how I did it in PHP:
<?php
$parameters = $_REQUEST;
$action = implode(array_keys($parameters['action']));
echo "Value of action: ".$action;
?>
the result will be:
Value of action: thevalue
--
That's all to it... well I hope I have given you another option on how to go around the subject.
Feel free to use the code above, and if you find it useful, I would greatly appriace if you atleast provide a feedback via comment.