Jump to content

Archived

This topic is now archived and is closed to further replies.

chico1st

radio button

Recommended Posts

I have 2 radio buttons in a form. I was wondering how to trigger a button if someone clicks on a different part of the form, like in a text box?
I searched it but i didnt know what to search for except "radio button" which gave me a million results

THANKS!

Share this post


Link to post
Share on other sites
[code=php:0]
<script type="text/javascript">
<!--
function check(name)
{
document.getElementById(name).checked=true
}

function uncheck(name)
{
document.getElementById(name).checked=false
}
//-->
</script>

<input type="radio" name="R1" value="V1" id="R1" /><BR>
<input type="text" name="text" onClick="check('R1');" />

[/code]

Thatll make it where if someone clicks in the text box it selects the radio button...

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.