Support » Plugin: Calculated Fields Form » Random sort “choices” of “Field Type: Checkboxes”

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

    (@codepeople)

    Hello @mevabien22

    Surprisingly everything is possible 😉

    Assign a class name to the checkbox field, for example: random

    Insert a “HTML Content” field in the form, with the following piece of code as its content:

    
    <script>
    fbuilderjQuery(document).one('showHideDepEvent', function(){
    var array = fbuilderjQuery(".random .dfield>div").get().sort( function() {
        return 0.5 - Math.random();
    });
    fbuilderjQuery(".random .dfield").append(array);
    });
    </script>
    

    and that’s all.

    I’m sorry, but if you need additional custom coding, you should contact us through our private website: Custom Coding Service

    Best regards.

    Thanks for the help,

    The code works very well,

    the only thing is that if the options have dependencies, even if the place options move, the dependencies do not.

    For example, option 1 will always show fieldname 8 and fieldname 11, regardless of the option in the first place.

    Plugin Author codepeople

    (@codepeople)

    Hello @mevabien22

    The solution in this case would be more complicated, and would dependen of form structure. Please, indicate the URL to the page where the form is inserted to check it in detail.

    Best regards.

    This is the url,

    acortar.org/HXceb

    thank you very much.

    • This reply was modified 1 month, 2 weeks ago by mevabien22.
    • This reply was modified 1 month, 2 weeks ago by mevabien22.
Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.