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

Question

Question

Read Only Fields

asked on February 20, 2014

I'm seeing some odd behavior in forms 9.1 with read only fields and attachments.  I've used both ways I know of to make the field read only and the problem persists.  I've used both the checkbox and javascript.  By using javascript I was able to get around the fields being blank when submitted, however when we put an attachment with the form the behavior changes.  I've tried several versions of IE, Firefox and Chrome with the same results.  It will all work great until I add an attachment.

 

To go deeper I was able to use the read only checkbox on a field that was pulling a stored procedure even with the attachment but it was not constant with submissions.

 

Anyone else having this issue?

0 0

Answer

APPROVED ANSWER
replied on February 21, 2014 Show version history

The issue you are experiencing is part of the issue where values do not get stored in the variables for read-only fields. When a file is uploaded there's a quick page refresh. When that happens and the filled field is read-only, Forms does not store a value to that field on submission.

 

You could use JavaScript to work around this issue. The following code assumes a filled field has the ro class, and the file upload field has the upload class.

$(document).ready(function(){
  $('.ro input').attr('readonly','True');
  $('.upload input').click(function () {   
    $('.ro input').removeAttr('readonly');
  });
  $('.upload input').blur(function () {
    $('.ro input').attr('readonly','True');
  });
});

So, when the user clicks the file upload button, we remove the read-only attribute from the filled field. That way, when the page refreshes, the field does not have the read-only attribute and Forms will store a value there. We make the field read-only again once the user browses away from the file upload field, which happens when they click the submit button or anywhere else on the form.

 

With that said, if it is possible, it's probably worthwhile to wait for the maintenance release to fix this issue.

 

UPDATE: Here's the hotfix that addresses this issue.

0 0
replied on April 3, 2014

When is the maintenance release expected to be released?

replied on May 6, 2014 Show version history

Hi Eric, I've attempted this workaround and it seems to work fine in Firefox, but doesn't work in Chrome or IE (tested in IE 11).

 

In Firefox, the read-only fields become active when the .upload is selected and then become read-only again when the focus is off the .upload field.  In Chrome and IE, it seems the read-only fields stay read-only when the .upload field is selected, and the values are cleared when the form is submitted.

 

Any idea why?  What would you recommend to make it work in Chrome and IE too?

 

Thanks!

0 0

Replies

replied on June 3, 2014

I would like to update that a hotfix has been released to address the issue specified in this topic.  Here's a link to the hotfix:

 

https://support.laserfiche.com/KB/1013483

1 0
replied on June 3, 2014

Thanks for pointing that out! I updated the answer above with that link.

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

Sign in to reply to this post.