When using multiple button elements in a form, I realized that IE7 sends innerHTML instead of the button value. Everything is good, what I thought, I just changed my PHP code to this
<?php
if (isset($_POST['button-name'])) {
add_product_to_cart(2);
}
?>
Now my old friend IE6 goes a little further, being a nuisance. It sends all the button elements no matter which one I click on. For example, I have three button elements named "mint", "near-mint" and "standard". Quick print_r($_POST)tells me that all 3 names have been sent.
I think there will be some kind of JavaScript to fix this, and not the most elegant situation, but I can imagine that the average user still using IE6 is not bright enough to turn off their JavaScript.
How can i fix this?
source
share