• Resolved lilu04

    (@lilu04)


    Hello,
    It is there a possibility to create conditional fields and to be required.

    For example, I have a dropdown and when someone selects something appears different fields. But if I put one conditional field required it becomes required for all the options.

Viewing 2 replies - 1 through 2 (of 2 total)
  • meneeroom

    (@meneeroom)

    I am also having this issue.

    It seems like this issue is being ignored due to many requests over 4 months ago.

    I will check it out to see if we could perhaps remove the “required” attribute with jQuery

    Please advise?

    • This reply was modified 8 years ago by meneeroom.
    meneeroom

    (@meneeroom)

    A temporary fix for the issue:

    When Option 1 is selected, the corresponding “show” field will be cleared, and the hidden required field will be set to N/A. When the user selects Option 2, the related field will then be cleared and the other field will be set to N/A

    
    <script type="text/javascript">
        jQuery(document).ready(function($){
           $('input:radio[name="billing_myfield12"]').change(
              function(){
                  if ($(this).val() == "Option 1") {
                      // alert('Option 1');
                      $('#billing_myfield15').val("");
                      $('#billing_myfield16').val("N/A");
                  }
                  else if ($(this).val() == "Option 2"){
                      //alert('Staff Account');
                      $('#billing_myfield15').val("N/A"); 
                      $('#billing_myfield16').val("");             
                  }
              }
          );
        });
     </script>
    
    • This reply was modified 8 years ago by meneeroom.
Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Conditional and required fields’ is closed to new replies.