You are viewing limited content. For full access, please sign in.

Question

Question

Field Rules - Can't hide File Upload Fields in different form section

asked on March 26, 2015 Show version history

I have a long form that has several File Upload fields grouped together at the bottom of the form. Based on what the person selects in some previous questions (check boxes or radio buttons), I need to hide some of the File Upload fields since they don't apply.

I have tried to set field rules for this but nothing I do will hide the file upload fields. I have tried the following logic:

 

Show file upload field if radio button is "Yes".

Hide file upload field if radio button is "No".

 

Neither of these rules has worked. I also have checked all the other field rules to make sure something wasn't causing a conflict and there are no other rules that point to these fields. All my other field rules are working as desired.

We are running Forms v9.2.1

Any suggestions for what to try next to get these fields to hide properly?

0 0

Replies

replied on March 26, 2015

Hi Eric,

 

I wasn't able to recreate your scenario.

 

By adding in the following field rules:

Note the pink portion as it can result in undesired behavior if you set it to "Is N" due to the null setting when the page initially loads.

 

Give this a go and let me know if it doesn't work!

 

Cheers,

Carl

0 0
replied on March 26, 2015

Of note, the Y and N are my radio button field values, not the option names. These may differ on your form.

 

0 0
replied on March 26, 2015

Thanks for the reply Carl.

I tried setting a different condition as you suggested and even tried assigning values to the radio button choices but nothing I do will cause the two file upload fields to hide.

The same field rule is suppose to show three separate fields: A description field (text) and the two file upload fields. When I open the form, the description field is hidden (as I would expect) and it shows when I toggle the radio button. However, the two file upload fields are always visible, no matter what the state of the radio button is.

I even tried breaking the two file upload fields out into a separate rule but that didn't work either. Here is how I currently have it set up:

 

Does it matter that the two file upload fields are in a completely different section group on the form than where the radio button is?

0 0
replied on March 26, 2015

Do you have a rule to hide the upload fields? Can you paste that one?

 

As far as it being in a different section, it may matter if that section is set to be collapsed or hidden. Even visible elements nested in a hidden element will remain hidden.

0 0
replied on March 26, 2015 Show version history

I just did a test and I think the problem is because the File Upload fields are not in the same section as the radio button that I am trying to control them with. I just created a new File Upload field in the same section with the radio button and it functions as desired (hidden until radio button is selected).

Here is that screenshot showing the two fields that are displayed when "Yes" is selected:

 

I then created a new File Upload field in another section and tried applying the same field logic to it and it did not work. So this has to be because the fields are in separate sections. I don't remember this being an issue in other forms but maybe I never tried it like this.

Is this a limitation of field rules or a bug?

0 0
replied on March 27, 2015

Hello Eric,

 

What Web Browser are you using and what version? Also is there any javascripting involved at all?

 

Regards,

Andrew

0 0
replied on March 27, 2015 Show version history

I have tried it in IE11, FireFox 36.04 and Chrome 41.0x and all three browsers exhibit the same behavior with the field always being visible.

The only javascript I have on this form is a mask for phone numbers and SS numbers:

(Note: server address was replaced with xxxxxx in the code copied below)

 

$(document).ready(function () {
 $.getScript('http://xxxxxxxxx.xxx/Forms/js/jquery.mask.min.js', function () {
    $(".ssn input").mask("999-99-9999");
    });
    });

$(document).ready(function () {
 $.getScript('http://xxxxxxxxxx.xxx/Forms/js/jquery.mask.min.js', function () {
    $(".phone input").mask("999-999-9999");
    });
    });
 

0 0
replied on March 27, 2015

Hello Eric,

 

Would you be able to open up a support case with your reseller? That way the Support Team can look into this issue further and determine where the issue may be as I have attempted to recreate your issue in a variety of set ups, but was unfortunately unable to.

 

Regards,

Andrew

0 0
replied on March 27, 2015

Ah wow!

 

I still can't recreate your scenario so I'm guessing there may be a conflict somewhere in your Form. Do any of the sections load hidden or have their own rules going on independent of these radio buttons?

 

I was able to try out a simplistic field rule (identically to my post above) and put the Radio and File Upload in different sections and it worked out fine.

 

Another option is to use javascript instead of field rules since there seems to be something conflicting. Here's the code for that.

$(document).ready(function(){
  
  // Hide the appropriate Fields when form first loads
  $('#q2').hide();
  
  // When the Radio button with ID Q1 changes values, hide or show the respect fields
  $('#q1 input[name="Field1"]').change(function(){
    
    if ($( this ).val() == "Y") {
     
     // Fields to Show when value is Yes 
     $('#q2').show();
      
    } else {
      // Fields to Hide when value is No
     $('#q2').hide(); 
    }
    
  });
  
});

*Note, to adopt to your situation, add the the appropriate fields to show and/or hide by adding the ID's in. So if you also wanted to hide q5, add it in separated by a comma so all the $('#q2') be $('#q2, #q5').

 

*Also, the radio button is identified by both the field name and the ID. So if your radio you want to act off is in ID Q7, change the #q1 and Field1 references to #q7 and Field7, respectively.

 

Let me know if that does the trick. Otherwise, at this point we may have to export and upload your form in it's entirety for a full look.

 

Cheers,

Carl

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.