Jump to content

How to 'uncheck' onclick?


realjumper

Recommended Posts

Hi,

 

the code below checks the radio button when the checkbox is selected. If the user changes their mind and un-checks the checkbox, how can I make it also un-check the radio button?

 

Thanks for your help  :)

 


<input type=checkbox onclick="if(this.checked)document.getElementById('cb3').checked=true">checkbox 1<br>

<input type=radio id=cb3 >radio 1

Link to comment
https://forums.phpfreaks.com/topic/86012-how-to-uncheck-onclick/
Share on other sites

i made this for a select/check box... but i think it'd work the same here...

 

function uncheck(el){
el=getObject(el);
if (el.checked==true) el.checked=false;
}

 

then... you can...

 

<input type=checkbox name="" id="234" onchange="uncheck('radio')">

 

... or whatnot...

Archived

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

×
×
  • Create New...

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.