Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

OnClick Checkbox Event ???

Status
Not open for further replies.

malphi

Programmer
Jan 27, 2003
2
CA
My problem is the following. I have two checkbox, and i want to have a event when i click one of them. So when i click one of them the other one become unchecked. And when i unchecked it back, the other one become checked.

Can someone help me with that ?

Thanks
 
You need to use radio buttons inplace of check boxes. Give each of them the same name and they will turn on and off when another is clicked.

<input type=&quot;radio&quot; name=&quot;radio1&quot; value=&quot;1&quot; />
<input type=&quot;radio&quot; name=&quot;radio1&quot; value=&quot;2&quot; />
<input type=&quot;radio&quot; name=&quot;radio1&quot; value=&quot;3&quot; />
 
Ok, but i can't use the radio button. I have to use the checkbox about the same way as when you are on a online mailbox, and you want to delete all email, there is a checkbox that check's all of them. I have try a couple of thing, but just can't seem to work.

Thanks

Malphi
 
ok, so do you want the one checked only option or do you as you say now what a function to check them all?

is there any particular reason why you want to use vbscript for this. these kind of functions a seemingly easier to perform with a bit of javascript. plus there are hundreds of exmaples out there to look at. _______________________________________________
{ str = &quot;sleep is good for you. sleep gives you the energy you need to function&quot;;
ptr = /sleep/gi;Nstr = str.replace(ptr,&quot;coffee&quot;);alert(Nstr); }

_______________________________________________
for the best results to your questions: FAQ333-2924
has you're questio
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top