• Resolved minichiello

    (@minichiello)


    Hello,

    I am currently using a multi-step form, and on a page there is a checkbox that if selected some input fields become required, but if I leave these required fields in the default form in the field and these are not filled in, the submission will not proceed.

    My question is whether there is an option to use the $form object in JavaScript, to enable this field to be required by default using JavaScript in the moment the checkbox field is selected, I am currently using JavaScript to make these input fields required in the HTML, but this is not an elegant way.

    Thank you.

Viewing 1 replies (of 1 total)
  • Plugin Support Tahmid ul Karim

    (@tahmidulkarim)

    Hi @minichiello,

    You can make a field required using JavaScript. You can find the field settings in the fluent_form_ff_form_instance_128_1 object. Here 128 is the ID of the form. So, replace 128 with your form ID to which you want to apply the code.

    For example, if you want to make an email field required, then the code will be –

    fluent_form_ff_form_instance_128_1.rules.email.required.value = true;

    Let me know if this works.

    Thank you!

Viewing 1 replies (of 1 total)
  • The topic ‘Required text inputs’ is closed to new replies.