Check box script

Hi All,
Just wanted to see anyone can point me to the good free script for check box selection.

Here what i would like the script to work, i have 4 selectable check box and they can be only be select one at the time.

Please advice.

thx

Why not just use radio buttons? It’s html feature, which does not require any scripting to work and if setup with same name it will work as you want it (only one at the time).

igv, thank for the update.
Radio buttons doesn’t work, i would like to have them to unselect too

I see, but I would add fifth radio button option, with something like “Nothing” or whatever works in your situation.

Be warned that users who are using your form will expect to be capable of selecting multiple checkboxes. They gain these expectations from their use of thousands of other web sites.

When you break those expectations, you do so at your own peril.

If you wish to explain your use-case situation, we may be able to advise you as to the most appropriate interface solution that meets your needs.

thx igv and pmw for advice.

@pmw57 here the form that we have created.
https://elotus.org/lotus_2010/registration/web_reg.html

Those are registration packages for the attendees to pick and as you see we would like them to be able to pick only once in the each package.

is that any ideal?

Thanks for all the advices.

so it looks like you require them to select at least one dates package in your form? if it’s correct, when radio buttons should work perfectly there.

It seems that you are wanting the checkbox to perform two different roles, which i causing the conflict for you.

You should have there a single checkbox for each package, and then use radio buttons for the gifts. If you want someone to attend but to decide they don’t want to receive a gift, use a third option for “No gift for me”

The intended structure would be


[ ] Watch It Free package:
    ( ) 1/23/10 Mix & Match 30 Formulas
    ( ) 1/24/10 Pulsynergy Made Easy
    ( ) No gift for me

[ ] Lecture Notes ONLY Package:
    ( ) 1/23/10 Mix & Match 30 Formulas
    ( ) 1/24/10 Pulsynergy Made Easy
    ( ) No gift for me

and so on

you both have give me a great advice.
If i go with the radio button as igv advice, someone decided to don’t want the any of the 1/23/10 package, they can’t unselect the radio button.

That where i think i need to find the script that able to unselect.

@pmw, the checkbox not going to work with the package structure we want.
as you see, each package has two seminars, we just wanted the user to be able to pick one from the each package. does it make sense? cause 1/23/10 is one semianr with three different options.

thx for the help.

So, i need to find that if there code or script to unselect for radio button.

Thanks for the clarification

The structure you seem to require is:


( ) 1/23/10 Mix & Match 30 Formulas
( ) 1/24/10 Pulsynergy Made Easy
    
    Select the packages you require
    [ ] Watch It Free package:
    [ ] Lecture Notes ONLY Package:
    [ ] 1-Day CEU package:

( ) 2-Day CEU package:

If however you do want to do something as boorish as unselecting a radio button, you can use this:


input.removeAttribute('selected');

What does this code mean? Are those arrays of some sort? Or is that just the basic outline of the program?

It’s pseudo-code for the intended form elements and their relationships. This makes it a lot easier to tell what’s going on from that, as compared with actual HTML code.

Thanks to that we were able to quickly figure out that the first solution wasn’t appropriate, and work our way to a more appropriate solution:

( ) 1/23/10 Mix & Match 30 Formulas
( ) 1/24/10 Pulsynergy Made Easy
    
    Select the packages you require
    [ ] Watch It Free package:
    [ ] Lecture Notes ONLY Package:
    [ ] 1-Day CEU package:

( ) 2-Day CEU package:

Hi guys, thanks for all the help and advice.
https://elotus.org/lotus_2010/registration/web_reg_test.html

ok… i’m going to go with radio button and seems pretty much working ok…
But got into the one issue… i can’t group the last package to the 01/24/2010 group to be function as i wanted.

Please check and see you can point me to the right direction.

thx

Radio buttons can only be grouped by using the a distinct name for each group.
It is not allowed to associate one radio button with two different groups.

It might be possible though for scripting to help achieve it.

is there a script that i can find?

Maybe not, but if your description of the desired behaviour is clear enough, someone might craft a script together for you.

ok… just the simple script that i need that for the form.
As of now, i’m pretty much good with first three packages selection with radio button, does work what i like the attendee to do.
But like you see, the last selection can’t able to do be in two different group so, kind of need the script that does.

Hi all,
i found this from forums.devshed.com

function check4check()
{
var box1 = document.getElementById(‘checkbox1’);
var box2 = document.getElementById(‘checkbox2’);
var box3 = document.getElementById(‘checkbox3’);
var box4 = document.getElementById(‘checkbox4’);
if (box1.checked == true)
{
box4.disabled = true;
box3.disabled = true;
box2.disabled = true;
box1.disabled = false;
}
else if (box2.checked == true)
{
box1.disabled = true;
box2.disabled = false;
}
else if (box1.checked == false && box2.checked == false)
{
box1.disabled = false;
box2.disabled = false;
box3.disabled = false;
box4.disabled = false;
}
}

it might work for me… haven’t try it yet… hope this could work.