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

Question

Question

Custom HTML fields not showing and hiding correctly when sending to Laserfiche

asked on May 4, 2015

I'm having some issues with getting a form to display the correct fields when it's sent into Laserfiche, so I'm hoping someone can help point out my errors!

I have a process with 2 forms. The first allows the user to select which fields (Custom HTML) should be shown and which should be hidden on the final form. When submitted, a reviewer receives the second form, which gets the selections from the first form and displays the fields that were selected for inclusion. The form for the reviewer displays correctly . The same form is then sent into Laserfiche when the reviewer hits the Submit button. However, when it gets into Laserfiche, it either shows too many fields or not any.

I've tried all kinds of javascript/jquery manipulations, but only one seems to work, and it won't give me the results I need.

If I use the code below and select the option for the "X-1" field, the field with the "x1lta" class should be shown. The works fine in the reviewer's form, but not when it's stored in Laserfiche:

$(document).ready( function(){
      $('.x1lta').hide();
      $('.x2lta').hide();
      $('.x3lta').hide();
      $('.x4lta').hide();
 
  if ( $('#q10 input').val() == "X-1" ) {
    $('.x1lta').show();
  }

});

 

If I remove the *.hide()'s at the beginning and put the last three in the "if" statement, all of the fields are displayed on the form in Laserfiche, but only the x1lta field is displayed on the reviewer's view of the form (which is correct).

If I move the $('.x1lta').show(); out of the if statement and put it below all the hides, the correct behavior happens and the stored document only shows the x1lta field. (I did that just for testing purposes.) So it seems like the hide and show methods work properly. The problem seems to be with the "if" statement. I know the code inside executes because I've used "alert" to let me know when it got inside the "if". I've tried putting a delay after the "if" statement, thinking that the code in the "if" statement doesn't execute before the document is sent to Laserfiche.

I need to be able to determine if each field was selected to be on the document and send only those fields into Laserfiche.

I've read a lot of questions/answers in this forum about the issues with showing and hiding fields (Custom HTML, to be more specific), and it seems that this can be a bit tricky. I've tried using the jQuery,  css method to set the display of each field, and I got the exact same results.

Any ideas?

0 0

Replies

replied on May 5, 2015

Hi there,

Does the value show up correctly in View Submission?

CustomHTML value is not a field value, so it's not submitted with form submission. You need to make sure the script running when fill in the form (which may trigger by the field change) still achieve the same behavior when load the submitted form (no field change), you can validate that through View Submission.

1 0
replied on May 10, 2015

The contents of the Custom HTML fields/areas are correct. The issue is that we don't want all of the Custom HTML fields to display when the form is sent to Laserfiche. We only want the ones that meet certain criteria to be displayed.  I can get all of them to be hidden if I use javascript to hide them at the beginning of the javascript. However, the javascript evaluates which ones should be shown and which ones shouldn't be shown and tries to hide/show each one individually. Nothing is changing on the form at that point. All the changes took place in another form and were reviewed in the form that gets sent into Laserfiche in the step before it gets sent to Laserfiche. All Custom HTML fields are shown correctly in that step. So, I just need to find out why they're evaluating correctly and displaying correctly on the form prior to it being sent into Laserfiche, and not being displayed correctly when they're sent in.

0 0
replied on May 11, 2015

Did you check the view submission of the form? Does it display correctly there?

0 0
replied on May 25, 2015

Sorry for the delayed response. I've had other projects to work on.

You're right, it doesn't show up when viewing the submission form. I had to find another way to do what we were looking for.

I'll check the view submissions in the future! Thanks!

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

Sign in to reply to this post.