stereopixel's script doesn't work with the <button> tag. If you try to get the set value for the button with 'this.value' IE will still send the innerHTML from the button tag.
I solved it by using the button tags name as the value instead and then accessing the value with 'this.name'. The server then requests the value from a hidden <input> with a specific name...
After reading all the page, it seems to me it is the best solution to this awful bug...
We only want to bypass a bug from IE, and we surely don't want to overload our codes because of it. stereopixel's solution corrected by snipes is quick and keeps everything relatively simple, clean and tidy.
Thanx everybody for your contribution, it helped me a lot ;-)
Comment
I needed this for image buttons.
My version of it, which I think is simple and effective (thanks to all the previous contributors) but needs javascript:
function imgClick(value)
{
document.getElementById('IEfix').value = value;
}
<form method="post" action="ACTION.PHP">
<input type='hidden' id='IEfix' name='imageButtonIE' value=''>
<input type='image' src='1.jpg' value='IMG1' name='imageButton' onClick='imgClick(this.value)' />
<input type='image' src='2.jpg' value='IMG2' name='imageButton' onClick='imgClick(this.value)' />
<input type='image' src='3.jpg' value='IMG3' name='imageButton' onClick='imgClick(this.value)' />
<input type='image' src='4.jpg' value='IMG4' name='imageButton' onClick='imgClick(this.value)' />
<input type='image' src='5.jpg' value='IMG5' name='imageButton' onClick='imgClick(this.value)' />
</form>
--------------------------
No need to specify a different name for each image, you get 'imageButton' = value on Firefox, and 'imageButton' = "" on IE.
Then if you check 'imageButtonIE' you get the codename value of the clicked image (you can put there the name, or the index...)
Replies
stereopixel's script doesn't work with the <button> tag. If you try to get the set value for the button with 'this.value' IE will still send the innerHTML from the button tag.
I solved it by using the button tags name as the value instead and then accessing the value with 'this.name'. The server then requests the value from a hidden <input> with a specific name...
After reading all the page, it seems to me it is the best solution to this awful bug...
We only want to bypass a bug from IE, and we surely don't want to overload our codes because of it. stereopixel's solution corrected by snipes is quick and keeps everything relatively simple, clean and tidy.
Thanx everybody for your contribution, it helped me a lot ;-)
this is a fantastic solution - thanks
Yes, this solution was my salvation, too. :)
Thank you very much!