On May 24, 12:56 pm, "Evertjan." <exjxw.hannivo
...@interxnl.net>
wrote:
> Darko wrote on 24 mei 2007 in comp.lang.javascript:
> > On May 24, 10:27 am, java.i...@gmail.com wrote:
> >> how to select only one check box in two checkboxes like radio buttons
> > Take a book on Javascript and English language, syntax and grammar,
> > then try it again and if you don't succeed, then come back here and
> > ask the question again, but with more details on what your problem is
> > (not only what you want to do even if you haven't tried it yourself)
> The OP could be right:
> That one in two checkboxes do like radio buttons.
> Don't you love them?
> --
> Evertjan.
> The Netherlands.
> (Please change the x'es to dots in my emailaddress)
HTML
<input type="checkbox" name="test" id="test" value="1"
onclick="check_it(this);" />
<input type="checkbox" name="test" id="test1" value="2"
onclick="check_it(this);" />
SCRIPT
function check_it(obj)
{
if (this.id == 'test' && this.checked) {
document.getElementById('test1').checked = false;
}
elseif (this.id == 'test1' && this.checked) {
document.getElementById('test').checked = false;
}
}
This is just a very simple way to do it.