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

Question

Question

Forms History does not show form field values that were set by javascript

asked on May 6, 2017 Show version history

With one specific form, when a user submits a form, any fields populated by javascript don't show the values that were set upon submission. I have a screenshot of the values of the field right before I clicked the submit button and one from the Monitor section where you can see an image of what the user submitted and they do not match up. What would cause the javascript fields to be erased in the history?

 

What the USER SEES

WHAT WE SEE

0 0

Answer

SELECTED ANSWER
replied on May 6, 2017

If you set the fields as Read Only from the Layout page, anything populated into them via Javascript won't be saved.  You have to leave them editable from the Layout page and make them read-only via the Javascript.

1 0

Replies

replied on May 8, 2017

Setting to read-only with javascript did the trick. Thanks!

2 0
replied on May 9, 2017

Crazy thing is happening. These forms that I built in the past for other customers, with read only fields populated by javascript, are suddenly all cropping up with this problem. I have been populating read-only fields for a long time without a problem. A search through the history shows that it intermittently is deleting the data. Even with forms submitted around the same time.

0 0
replied on May 8, 2017

As Matthew said but I found the same when using the disabled property.

To get around this issue, I remove the "disabled" property upon submit. I presume the same thing can be done with the ReadOnly property.

-Ben

 

1 0
replied on May 8, 2017

Yes, very true.

0 0
replied on May 8, 2017 Show version history
  $('.Submit').on('click', function() {
    $('.myInputField input').prop('disabled',false);
    $('.myOtherInputField input').prop('readonly',false);
  });

...will probably fix the problem

replied on May 8, 2017 Show version history
  $('.Submit').on('click', function() {
    $('.myInputField input').prop('disabled',false);
    $('.myOtherInputField input').prop('readonly',false);
  });

...will probably fix the problem.

However, this might not work on an iOS device nor in the Off-line mode on an Android. Would be great if someone with an iOS (and time) could test this and let me know :)

-Ben

You are not allowed to follow up in this post.

Sign in to reply to this post.