Log in

View Full Version : Problem with radio button reset??



dmitryseliv
06-13-2006, 06:04 AM
Have a little problem with a script. It works fine but it does not change icon back to default one on first radio button when you move focus on to a next radio button.
Thought work correctly with checkboxes.

Any help appriciated??

<script type="text/javascript">
function changeIcon(chk,icon){
if (chk.checked){
document.icon.src="images/i_s001_on.gif";
}else{
document.icon.src="images/i_s001.gif";
}
</script>
<input name="sent_opt1" type="checkbox" value="be_notified" onClick="changeIcon(this,icon);"/>
<img src="images/i_s001.gif" width="21" height="21" name="icon"/> Be notified
<input name="sent_opt1" type="radio" value="1" /><img src="images/i_s002.gif" width="21" height="21" />

djr33
06-13-2006, 06:08 AM
Just a random guess, but can radio buttons be "checked", or would it be "selected" or something else?

dmitryseliv
06-13-2006, 10:09 PM
Hi!

Please do not reply unless you know what you talking about.

Cheers,DS