[attachment=0]Form.PNG[/attachment]
On clicking "Calculate" I am needing to achieve the following:
1) Calculate how many radio buttons have been selected - I am not sure of how to code this.
2) The calculate button must only work if one or more radio buttons are selected.
[attachment=1]RadioButtons.PNG[/attachment]
I Am using Multi Pages to move to the next section.
On clicking "Calculate" I am needing to achieve the following:
1) Calculate how many radio buttons have been selected - I am not sure of how to code this.
2) The calculate button must only work if one or more radio buttons are selected.
[attachment=1]RadioButtons.PNG[/attachment]
I Am using Multi Pages to move to the next section.
Hi,
A quick code, not tested though🙂
your radios should have the same class:
Regards,
Max
A quick code, not tested though🙂
your radios should have the same class:
var total = 0;
$$('.class_here').each(function(rad){
if(rad.checked == true){
total = total + 1;
}
});
if(total > 0){
//do here what you need!
}
Regards,
Max
Hi Max, Chronoform generates the following type of code
When I go to configure the radio button via the wizard, I can't see where to set the class. I am probably missing something that is very obvious 😶
<div class="ccms_form_element cfdiv_radio" id="narrowlabel_container_div" style="">
<label for="NarrowLabel">Mon</label>
<input type="hidden" name="Monday" value="" alt="ghost" />
<div style="float:left; clear:none;">
<input type="radio" name="Monday" id="monday_0" title="" value="0" checked="checked" class="" />
<label for="monday_0">N/A</label>
<input type="radio" name="Monday" id="monday_1" title="" value="CLA" class="" />
<label for="monday_1">Cyber A</label>
<input type="radio" name="Monday" id="monday_2" title="" value="MLA" class="" />
<label for="monday_2">Minecraft A</label>
</div>
<div class="clear"></div>
<div id="error-message-Monday"></div>
</div>
When I go to configure the radio button via the wizard, I can't see where to set the class. I am probably missing something that is very obvious 😶
Hi abasel,
I think that you can probably do it by wrapping a div around the radio block - or in your case, as they are the only radio buttons in the form, use the form class as a selector like this (not tested):
Bob
I think that you can probably do it by wrapping a div around the radio block - or in your case, as they are the only radio buttons in the form, use the form class as a selector like this (not tested):
var radios = $$('.Chronoform radio:checked').length;
if ( radios > 2 ) {
// do something . . .
}
Bob
This topic is locked and no more replies can be posted.