Not all values posted with a form in IE
I am, hypothetically (
) working on an e-commerce site, and the other day I discovered that IE doesn’t post all values with a form.
Imagine a list of articles with a buy button on each row. Basically, what it needs to know is the id of the article to be bought and the quantity. My initial idea was to have one input element for quantity and one input type="image" button, with the article id as a value, used to post the form. Basically, I felt that an extra hidden element would be just superfluous. For example:
<form action="somewhere.php" method="get">
<input type="text" name="quantity" value="1">
<input type="image" name="buy" src="images/buy.png" alt="Buy" value="article-57">
</form>
The expected result in the query string should be:
?quantity=1&buy.x=&buy.y=&buy=article-57
But in IE 6 nd IE 7, it’s;
?quantity=1&buy.x=37&buy.y=15
Quite weird, isn’t it? And from what I seen, this only applies to input type="image" elements. What’s extra annoying is that it sends its x and y values, which are the actual coordinates where you clicked on the button. Why the IE team would think that the coordinates of the click is more important than the actual value is beyond me…


