tag:blogger.com,1999:blog-16916381.post116506595796400790..comments2009-04-13T11:21:12.401-07:00Comments on Jungli Geek: Button tag problems and IE 6V. Narayan Ramanhttp://www.blogger.com/profile/18094480866664974663noreply@blogger.comBlogger6125tag:blogger.com,1999:blog-16916381.post-23045058957083617432009-04-03T23:30:00.000-07:002009-04-03T23:30:00.000-07:00you guys can also try this approach :)http://thesp...you guys can also try this approach :)http://thespotontheweb.blogspot.com/2009/04/trouble-using-element-in-ie7.html :<BR/><BR/>Trouble using <button> element in IE (internet Explorer)<BR/>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".<BR/><BR/>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.<BR/><BR/>Instead, I used the following to get around the issue:<BR/><BR/><button name="action[thevalue]" >TEXT</button><BR/><BR/>when submitted the result array will be like this:<BR/><BR/>Array ( [action] => Array ( [thevalue] => TEXT ))<BR/><BR/>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:<BR/><BR/><?php<BR/>$parameters = $_REQUEST;<BR/>$action = implode(array_keys($parameters['action']));<BR/>echo "Value of action: ".$action;<BR/>?><BR/><BR/>the result will be:<BR/>Value of action: thevalue<BR/><BR/>--<BR/><BR/>That's all to it... well I hope I have given you another option on how to go around the subject.<BR/>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.Spothttp://www.blogger.com/profile/13644550637781402311noreply@blogger.comtag:blogger.com,1999:blog-16916381.post-1168228807897052162007-01-07T20:00:00.000-08:002007-01-07T20:00:00.000-08:00try this, place onSubmit or onLoadobjs = document....try this, place onSubmit or onLoad<BR/><BR/>objs = document.getElementsByTagName("button");<BR/>for (i=0; i < objs.length; i++){<BR/>objs[i].value = objs[i].attributes.getNamedItem("value").value;<BR/>}Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-16916381.post-1168228774776836492007-01-07T19:59:00.000-08:002007-01-07T19:59:00.000-08:00i had the same problem, try following, it works fo...i had the same problem, try following, it works for me<BR/><BR/>use this in onSubmit or onLoad<BR/>objs = document.getElementsByTagName("button");<BR/>for (i=0; i < objs.length; i++){<BR/>objs[i].value = objs[i].attributes.getNamedItem("value").value;<BR/>}Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-16916381.post-1167391447389191822006-12-29T03:24:00.000-08:002006-12-29T03:24:00.000-08:00I think your observation not correct, you are talk...I think your observation not correct, you are talking about button tag and fix it using input tag, the behavior is consistent both for IE and Firefox for Input tag.santhoshhttp://www.blogger.com/profile/18366552674053728448noreply@blogger.comtag:blogger.com,1999:blog-16916381.post-1165984389693955902006-12-12T20:33:00.000-08:002006-12-12T20:33:00.000-08:00What you suggest is what is simple and right in mo...What you suggest is what is simple and right in most cases. The solution was to handle the scenario without javascript. I should have mentioned that in the post.Narayan Ramanhttp://www.blogger.com/profile/18094480866664974663noreply@blogger.comtag:blogger.com,1999:blog-16916381.post-1165238803261847962006-12-04T05:26:00.000-08:002006-12-04T05:26:00.000-08:00you can use a hidden field for the entire form (in...you can use a hidden field for the entire form (instead of using one hidden field for each visible button) which would carry the value of the button clicked to the server. <BR/><BR/>In onclick you can set the current button's value to the hidden field, and you can submit the form through Javascript!Anonymousnoreply@blogger.com