Note that there are some explanatory texts on larger screens.

plurals
  1. POShow/Hide with Multiple Radio Buttons
    primarykey
    data
    text
    <p>I am very new to building forms with js. I copied and applied a bit of code to get fields to pop up depending on the Radio button I select. This works great for two radio buttons, but my issues is that I want to include several (5+) and would like to reset the fields with every change. </p> <p>I was thinking I can input additional code to reset all fields "onchange" but I can't get this piece of code to work... here is what I copied and modified for my use:</p> <p>works great with 2 buttons as designed:</p> <pre><code>{ toggleSelectionFields: function() { var isLaptop = ca_fdIsSelectRadio('showhide','group','short'); if (isLaptop) { ca_fdHideField('showhide','longfields'); ca_fdShowField('showhide','shortfields'); } else { ca_fdHideField('showhide','shortfields'); ca_fdShowField('showhide','longfields'); } } } </code></pre> <p>Here is what I tried to do:</p> <pre><code>{ toggleSelectionFields: function() { Var discovery = ca_fdIsSelectRadio('phone','deskphone4610','selectproblem','SelectIssue','discovery'); Var headset = ca_fdIsSelectRadio('phone','deskphone4610','selectproblem','SelectIssue','headset'); Var fac = ca_fdIsSelectRadio('phone','deskphone4610','selectproblem','SelectIssue','feature'); Var calls = ca_fdIsSelectRadio('phone','deskphone4610','selectproblem','SelectIssue','calls'); if (discovery) {ca_fdShowField('phone','deskphone4610','selectproblem','discovermode')} if (headset) {ca_fdShowField('phone','deskphone4610','selectproblem','headset')} if (fac) {ca_fdShowField('phone','deskphone4610','selectproblem','feature')} if (calls) {ca_fdShowField('phone','deskphone4610','selectproblem','calls')} } } } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload