1 Reply Latest reply on Oct 3, 2013 2:51 PM by 8442

    how do i make 1 field OR another be required

    Trish Voskovitch
      i want to have 2 fields on a form but  set it up so that only 1 of the fields is required- if they fill out question A they don't have to do B or if they fill out B they don't have to do A.  but they have to do one or the other.
      does anytone know how to do this or if it can even be done?
        • Re: how do i make 1 field OR another be required
          That can be achieved through JavaScript/jQuery.

          The code will be similar to

               <s c r i pt>
                       $(document).ready(function (){
                           $("#input_b").change(function() {
                               if ($(this).val() != "") {
                                   $("#input_a").show();
                               }else{
                                   $("#input_a").hide();
                               } 
                           });
                       });
               </s c r i p t>
                
               * spaces added to the word "script" to avoid the portal interpreting as a script.