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

Question

Question

Dynamic Custom HTML Field - Not Updating On Form Submission

asked on March 20, 2018 Show version history

Hello All,

I've been working with Laserfiche Forms lately and have been learning the quirks here and there and working around them for the most part.

But, I don't have a good idea on how to solve this particular issue. I've created a Input box on my Test Form (see screenshots attached), and wrote some jQuery code to capture the contents of the "Requested For: " input box and dynamically write this value into the Custom HTML section. 

While I am able to do what I've stated above, when the form is submitted, the changes in the Custom HTML section is not reflected on the following Thank You! page nor the Email with the PDF form attached. 

So, the question is, is this even possible? I can fallback and just reword the paragraph, but just wondering if there was any potential solutions to this issue.

This isn't a real form, just one a created to show an example of what issue I was running into.

Thanks in advance for any help.

custom_html_issue_00.jpg
custom_html_issue_01.jpg
custom_html_issue_02.jpg
0 0

Answer

SELECTED ANSWER
replied on March 22, 2018

Try adding script like this (below your script):

  if ($('#q3 div.ro')) {
      $('#jq-req-for').html('<b><u>' + $('#q3 div.ro').text() + '</u></b>');
      $('#jq-req-for').css("background-color", "yellow")
  }

 

2 0

Replies

replied on March 20, 2018

Hi Cuong,

It seems that your custom script does not handle the case for read-only form (submitted form and form saved to repository)

There is no "input" element on the read-only form, instead, div element is used.

1 0
replied on March 21, 2018

Hello Rui,

Are you saying that the Custom HTML field is "read-only" and cannot be changed? If so, is there any field (or any other way) that I can mimic this behavior, but for it to appear on the submitted form? I basically have a span with an ID and in the jQuery, the span's html (innerHTML) is updated as the user types into the Requested For: input field.

I figured that Laserfiche Forms doesn't expect this Custom HTML field to change, but I was wondering, is there a way to override this behavior?

Thanks again.

custom_html_issue_03.jpg
0 0
replied on March 21, 2018

No, you can always change the custom HTML field appearance with custom script;

The issue I said was that, if your script gets value from "input" element on the "Requested For" field, you need to update script to get text from "div" element on the read-only form:

You can post your script here so we can check it.

0 0
replied on March 22, 2018 Show version history

The problem is that I need to grab this Name from the user (so I use a Single Line input field) and immediately after, update the CustomHTML Field as the user types into the Single Line input field above. So, to get the effect I want, I'm not sure if I can grab from a div field. I've attached a small video of what my code does currently.

In jQuery I have:

  $('#Field3').keyup(function(){
      $('#jq-req-for').html('<b><u>' + $(this).val() + '</u></b>');
      $('#jq-req-for').css("background-color", "yellow")
  });

Then in the Custom HTML field I have the text that I want to display along with the span (with id jq-req-for) to grab this value.

Thanks again.

0 0
SELECTED ANSWER
replied on March 22, 2018

Try adding script like this (below your script):

  if ($('#q3 div.ro')) {
      $('#jq-req-for').html('<b><u>' + $('#q3 div.ro').text() + '</u></b>');
      $('#jq-req-for').css("background-color", "yellow")
  }

 

2 0
replied on March 23, 2018 Show version history

Thanks for all the help Rui Deng,

This does seem to solve the issue! I guess I misunderstood your first reply saying the input element doesn't exist on the submitted form. 

Very helpful answer.

0 0
replied on January 23, 2019

Can anyone provide us in details how to do that ??

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

Sign in to reply to this post.