CalcBuilder Forum

Hide/Show form sections depending on select radiobutton

User moon_1338 2013-11-25 09:55:47

during construction calculator I took the "Example calculators: Hide / Show form sections depending on the select combo box (I)". I would like to get the same effect when using radiobutton. Could I have a short code javascript, which acted to on radiobutton? :)

Best Regards,
Marcel Haberski

Moonsoft support 2013-11-25 10:12:15

the lines to get this working with radiobuttons are similar, but the selector to find checked option changes a little bit. We suggest to download the second example (using slide effect). It uses a simpler sintax and the only changes you'd need to do to use radiobuttons based on that example:

- Change the field optfield from 'option list' type to 'radiobutton' at fields configuration.

- At the js tab, the code would be:

//we hide all sections

//when radiobutton is changed:

//hide all sections

//get the checked option to build the name of the section to be shown.


Please contact again if you need more help with any of the steps.


User moon_1338 2013-11-25 10:56:47

thanks for the quick reply :)

script works, but still I would like to find out how to get to a particular radiobutton to trigger a specific event (as in the case of option list: "if (elemSelected == 'opt4') {...}")
the name of my field of radiobutton is "second_tab" and radiobuttonns turn: val1, val2, val3

regards :)

Edited by moon_1338 - 25.11.2013 10:57

Moonsoft support 2013-11-25 12:55:40

the value returned is at this part:


So, you can recover which option is selected:

var selected=CB("input:checked").attr("mv_option");

and then apply the conditions needed:



Hope this helps, regards

User moon_1338 2013-11-25 16:25:14

work!, thank you! :)

Support/development 40 hours

With the peace of mind of having a professional team at your service (20% discount)

Buy now!

Create dynamic calculators

Buy now!