Hexagora Forum
Hexagora Forum
Home | Profile | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Dynamic HTML Editor
 Dynamic HTML Editor
 Selecting only one checkbox
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Martin1
Super User

Netherlands
626 Posts

Posted - 05 Nov 2005 :  17:42:02  Show Profile  Reply with Quote
Hello all,

I have a question. I have a form on my page with some checkboxes and radiobuttons.

I only want to allow the checking of one checkbox per question and the same goes for the radiobutton.
So for example I ask a question.
Are you a man:
Checkbox NO - checkbox YES

Obviously you need to choose one or the other. If you fill in YES and you change your mind (for whatever strange reason ) and you fill in NO, the checkbox that was previously filled in (the YES checkbox) needs to be cleared.

Anyone understand my question and know how to do this?

Regards,

Martin

s.dav
Site Admin

Italy
3364 Posts

Posted - 06 Nov 2005 :  09:46:34  Show Profile  Visit s.dav's Homepage  Reply with Quote
For this you have to create two options and give them a unique name ex: "question1" so they will be mutually exclusive ;-)

Regards, Davide
Go to Top of Page

Martin1
Super User

Netherlands
626 Posts

Posted - 07 Nov 2005 :  15:49:58  Show Profile  Reply with Quote
Hey I thought you were away for 10 days:-)

I am not totally sure what you mean. I have a form in this I have two checkboxes.
In the properties panel one has the ID Check1 and the other has the Id Check2.
I gave them each a value namely Check1 has the value yes and Check2 has the value no.

But I can still select them both.

The same issue goes for the radiobutton by the way.

What am I doing wrong?

I thought that the checkboxes/radiobuttons should have the same Id but then I get an error stating that they have the same Id and I can't preview the page.

Martin

Edited by - Martin1 on 07 Nov 2005 15:51:55
Go to Top of Page

jtarin
Super User

Russia
444 Posts

Posted - 09 Nov 2005 :  06:41:39  Show Profile  Visit jtarin's Homepage  Reply with Quote
Checkboxes have to be unchecked to clear.....radio buttons by default are similar to the old car radio buttons, you can never push two at once.Its not possible to have checkboxes act as radio buttons. They are two distinct forms.Use radio buttons for your example above. Checkboxes are for lists where more than one answer is applicable and/or desired.

Porky
www.pacificwavetour.com

Edited by - jtarin on 09 Nov 2005 06:42:30
Go to Top of Page

s.dav
Site Admin

Italy
3364 Posts

Posted - 15 Nov 2005 :  09:18:04  Show Profile  Visit s.dav's Homepage  Reply with Quote
Very good jtarin,
martin, you have to use the radio box using the property "name" for grouping them ;-)

Regards, Davide
Go to Top of Page

Martin1
Super User

Netherlands
626 Posts

Posted - 15 Nov 2005 :  13:24:09  Show Profile  Reply with Quote
Hmmmm I kinda knew that about the checkboxes but just hoped it could be done someway:-)

Anyway I have got it now so thanks for the help jtarin and Davide.

By the way how were your 10 days off? I hope you enjoyed them Davide:-)

Martin
Go to Top of Page

s.dav
Site Admin

Italy
3364 Posts

Posted - 16 Nov 2005 :  11:44:07  Show Profile  Visit s.dav's Homepage  Reply with Quote
;-) I have gone here:

http://www.maldive.at/ellaidoo-i.htm
http://www.intourist-maldives.com/resorts/ellaidhoo.html

very nice ;-)

Regards, Davide
Go to Top of Page

Martin1
Super User

Netherlands
626 Posts

Posted - 16 Nov 2005 :  13:35:40  Show Profile  Reply with Quote
Wow!!!

My sister has been there and it is very nice indeed. Lucky you[2 H:)]
Go to Top of Page

jtarin
Super User

Russia
444 Posts

Posted - 07 Jan 2006 :  21:44:20  Show Profile  Visit jtarin's Homepage  Reply with Quote
Martin 1...found a javascript that will allow you to have your guest select one checkbox and one checkbox only, rather than multiple. Don't know if you can still use it but here's the link.
"Limits the number of checkboxes a user may click by deselecting the others upon selection."
http://javascript.internet.com/forms/select-one.html

Porky
www.pacificwavetour.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Hexagora Forum © s.dav Go To Top Of Page
Snitz Forums 2000