more on images as form buttons
Posted: Mon Dec 15, 2003 9:02 am
Recently i found through the use of this a way of using buttons as images. i.e.
<input type="image" src="images/add.png">
<input type="hidden" name="add">
for HTML
and to process it (php):-
if (isset($_POST['add'])) {
}
this works if you have one button on the form. But if you have more than one it seems not to work. i.e if you add a delete button and have the hidden name as delete and process it using php. After trying that whatever button you press it runs both. Is there a way you can separate the two, so they will process when each individual button is pressed.
Also a second question-how can i make an image button act like a generic reset button and reset all the fields.
thanks.
<input type="image" src="images/add.png">
<input type="hidden" name="add">
for HTML
and to process it (php):-
if (isset($_POST['add'])) {
}
this works if you have one button on the form. But if you have more than one it seems not to work. i.e if you add a delete button and have the hidden name as delete and process it using php. After trying that whatever button you press it runs both. Is there a way you can separate the two, so they will process when each individual button is pressed.
Also a second question-how can i make an image button act like a generic reset button and reset all the fields.
thanks.