Click to See Complete Forum and Search --> : radio buttons vs images


oo7ml
03-06-2007, 08:56 AM
I have a rate bar on my page. I want to use images that i have created as the rate bar instead of the radio buttons i have already as seen below

<form METHOD="post" NAME="rating" ACTION="<?php echo $_SERVER['PHP_SELF']; ?>">
<tr>
<td><input TYPE=RADIO NAME="rating" VALUE="1"></td>
<td><input TYPE=RADIO NAME="rating" VALUE="2"></td>
<td><input TYPE=RADIO NAME="rating" VALUE="3"></td>
<td><input TYPE=RADIO NAME="rating" VALUE="4"></td>
<td><input TYPE=RADIO NAME="rating" VALUE="5"></td>
<td><input TYPE=RADIO NAME="rating" VALUE="6"></td>
<td><input TYPE=RADIO NAME="rating" VALUE="7"></td>
<td><input TYPE=RADIO NAME="rating" VALUE="8"></td>
<td><input TYPE=RADIO NAME="rating" VALUE="9"></td>
<td><input TYPE=RADIO NAME="rating" VALUE="10">
<input type="hidden" name="id_value" value="<?php print $id_to_rate;?>"/></td>
</tr>
<tr>
<td colspan=10 align=center><input TYPE=SUBMIT VALUE="Rate me!"></td>
</tr>
</form>

If i change the input type to images and use images, how will the score rated be submitted as once i get rid of the radio buttons there is know need for a Submit button

benifactor
03-06-2007, 09:06 AM
link the images with the values...

lets say 1 for instance..

<a href=ratepage.php?rating=1&id_to_rate=<?php echo("$id_to_rate"); ?><img src=blah blah blah/></a>

Ultimater
03-06-2007, 04:40 PM
Might want to also check out
<input type="image" src="1.png" alt="1">
and/or
<button><img src="1.png" alt="1"></button>
INPUT TYPE="IMAGE" submits the FORM just like INPUT TYPE="SUBMIT" and the BUTTON element.

It should also be noted that the TR element is illegal within the FORM element directly, according to the specification. The following template should be used instead.

<form><table>...</table></form>