Hello php coders,
I am creating a form that uses images instead of buttons to submit information and I found some problems: type=image does not pass the value.
I am creating this system to delete lines from a shopping cart, therefore every "delete" button has a different value but I am not able to get it once the form is processed.
Exmaple:
<table>
<form name="formulario" action="pruebas.php" method="post">
<tr>
<td>
<input name="delete" type="IMAGE" value="7" src="a.gif" width="70" height="26" border="0">
</td>
</tr>
</form>
</table>
once this form is submitted I echo $delete and nothing appears on the screen, I could use $delete_x and get the some screen coordinates.
I got a workaraound but it looks a little complex:
I inserted the value of the button inside the name tag like
name="delete_id"
while (list ($clave, $val) = each ($HTTP_POST_VARS)) {
if (ereg("x", $clave) > 0){
$clave2_array = explode("_", $clave);
$clave2 = $clave2_array[1];
echo "The value is" . $clave2 . " and the button is" . $clave2_array[0];
} // if
} //while
this way I get the value passed.
This problem only happens on IE, Mozilla treats the type=image as a type=submit.
Did you find any other solution to this?
Thanks