Here are the line that create two submit buttons in a loop (i has a value from 1 to n). So I have an edit and a delete button on each item line. These have an associated value of item index. Now I can check btn_edit and btn_del and handle associated item.
<button type=\"submit\" name=\"btn_edit\" value=$item[i]>Edit</button>
<button type=\"submit\" name=\"btn_del\" value=$item[i]>Del</button>
With FF only the value of pressed button is passed. You can evaluate action easily, the other button is empty. You also have the item value. Everything looks and works fine in FireFox.
Run the same form in IE and be ready for shock:
- Internet Explorer doesn't understand value clause in button tag!
- It passes the caption of buttons as the value - Edit/ Del in above case!!
- No matter which button is pressed, it passes button caption to the value property for all the buttons!!!
There are many words on this problem, and a lot of work-around too, but a work around is not a solution! I need to keep exploring this, until I find a work around that is pretty close to a proper solution. Or, I need to change structure and give up BUTTON tag.
It is interesting to note in WDG documentation on HTML 4.0:
"However, BUTTON is new in HTML 4.0 and poorly supported among current browsers, so INPUT is a more reliable choice at this time."
Do they mean Internet Explorer when they say "current browsers" ?
ajaysajay
No comments:
Post a Comment