Javascript rule to uncheck some cases if another is checked

georgie

Member
Hi Boss !

That is :

I have a field, checkbox type, called "day1".
This field have 3 boxes : "Morning", "Afternoon" and "No".

"Morning" and "Afternoon" can be checked both. But I would that if someone check "No", after to have checked another, then "Morning" and "Afternoon" be unchecked.

I have tried some Javascript code, but... I can not !!!:( Please help me !:p

THX
### FabrikRocks
 
what code did you try - can we see an example of the page?
Googling on "jquery deselect other checkboxes" gave me quiet a few results explaining how to do this.
 
OK thanks

A code that I have tried is like this, juste to empty the field :

Code:
  var block = Fabrik.getBlock('form_77');
    var jour1_el = block.formElements.get('inscriptions_evenements___jour1');   
    var jour1 = project_ohms_el.getValue();
    if (jour1 == 'Non') {
        jour1_el.update('');
    }

But it is not exactly that I would. I would keep only 'Non' if this value is selected, and unchecked others.

You can see the page here : http://driihm.fr/inscription-3eme-seminaire-driihm-2015

It is about the field called "Je participerai au s?minaire le lundi ?" ("jour1" in database).

Thanks for your help !
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top