I need to find a viable solution for using an image as an input. The catch is, it has to be in a scroller that is user operated. I have that code, but I need to find out how to set a radio button when that particular image is selected. A javascript onclick perhaps? Any thoughts are appreciated, Tim
sorry, can you please describe more about what program are you planning to create? and what language?
As above, dont get what you are trying to achive? Are you trying to get users to click an image (eg - chose your favourit image?) Are there any other inputs on the page or is it simply clicking on one image?
Sorry. Php, javascript and HTML are what I have to use. It should work like this: <-|| Image1 | Image 2... ||-> || o | o || Code (markup): What will happen is each image should be somehow linked to the radio button below it. You can scroll through, select what image you want, click it, and it will fill the radio button for you. If possible, I would like to eliminate the radio button altogether, and make it so once you click the image, it sets a hidden value, ready to be posted to a form. Is this even possible?
It would be easier to have a hidden field and assign its value using javascript with an onclick function on the images based on the image clicked.
How would I go about assigning its value? Onclick of image, getelementid of radio box? Here is my current code (smarty): <td align="center"> {assign var="prizedesc" value=$prize->description|nl2br} {assign var="prizedesc" value=$prizedesc|escape:"javascript"} <img src="{$prize->imgurl}" onMouseOver="return escape('{$prizedesc}');"><br> <b>{$prize->name}</b><br> {if $for_points} ({$prize->points_required} Point{if $prize->points_required != 1}s{/if})<br> {elseif $is_cash} ${$prize->cash_required} Minimum<br> {else} ({$prize->referrals_required} Referral{if $prize->referrals_required != 1}s{/if})<br> {/if} {if $first == "true"} <input type="radio" name="prizeid" value="{$prize->id}" checked> {assign var="first" value="false"} {else} {if $selected_prize == $prize->id} <input type="radio" name="prizeid" value="{$prize->id}" checked> {else} <input type="radio" name="prizeid" value="{$prize->id}"> {/if} Code (markup):