• Resolved PB

    (@ohtusabes)


    Hi @codepeople,

    I have five different radio buttons fields, each with one option and a figure. In this way I am not able to select a radio button independently from the others. I mean, when I choice one the others should turn off. Is there a solution to fix it?

    Thanks in advance

    The page I need help with: [log in to see the link]

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author codepeople

    (@codepeople)

    Hello @ohtusabes

    Thank you very much for using our plugin.

    You don’t have a radio button field with multiple choices, you have separate radio button fields.

    So, in your case, you must emulate the process by coding.

    Please insert an “HTML Content” field in the form and enter the following piece of code as its content:


    fbuilderjQuery(document).on('click', '#fbuilder [type="radio"]', function(){
    let me = this;
    fbuilderjQuery('#fbuilder [type="radio"]').each(function(){
    if(this.id != me.id) getField(this).setVal(0);
    });
    });

    Best regards.

    Thread Starter PB

    (@ohtusabes)

    Hi @codepeople,

    I did as you indicated but it didn′t work. https://app.ucimhef.org/?cff-form=72

    Plugin Author codepeople

    (@codepeople)

    Hello @ohtusabes

    I’m sorry, you must include the code into a pair of <script></script> tags:


    <script>
    fbuilderjQuery(document).on('click', '#fbuilder [type="radio"]', function(){
    let me = this;
    fbuilderjQuery('#fbuilder [type="radio"]').each(function(){
    if(this.id != me.id) getField(this).setVal(0);
    });
    });
    </script>

    Best regards.

    Thread Starter PB

    (@ohtusabes)

    Hi @codepeople,

    It works now. Thank you. And how I set the calculated field? I have troubles here when selecting each radio button.

    Plugin Author codepeople

    (@codepeople)

    Hello @ohtusabes

    Please describe the equation and include its code.

    Best regards.

    Thread Starter PB

    (@ohtusabes)

    Hi @codepeople,

    You can see the equation in https://app.ucimhef.org/?cff-form=72. The results should be “Grado 1”, “Grado 2”, “Grado 3″,”Grado 4” or “NE”. I only obtain “0” or “NE”. Thank you.

    Plugin Author codepeople

    (@codepeople)

    Hello @ohtusabes

    Since the radio buttons are separate fields and not choices of the same radio buttons field, you must check its value before returning it:


    (function(){
    if(fieldname97) return fieldname97|r;
    if(fieldname100) return fieldname100|r;
    if(fieldname102) return fieldname102|r;
    if(fieldname103) return fieldname103|r;
    if(fieldname106) return fieldname106|r;
    })()

    Best regards.

    Thread Starter PB

    (@ohtusabes)

    Hi @codepeople,

    It works perfect.

    Thank you so much.

Viewing 8 replies - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.