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

Question

Question

Saved PDF document (in repository) does not show the field value?

asked on December 8, 2014

HI

 

I am using the Javascript(see previous discussion) to get the device time into the field.   It works fine on the form but when I open the save PDF in the repository the time is not there (the field is blank).      What could be causing that?  

The code I am using is: 

 

$(document).ready(function(){
   
  function setcurrenttime (){
      var currentdate=new Date();
      var datetimenow=(currentdate.getHours())+ ":"
        + currentdate.getMinutes();
    
      $('#Field280').val(datetimenow);
      }
      setcurrenttime();
    });

 

   

Note: I had similar issue before with loo-kup DB value in the field which was fixed with applying lf hot fix.  My current version is Laserfiche Forms Version 9.1.1.1522 (that has the hot fix applied).

0 0

Answer

SELECTED ANSWER
replied on December 10, 2014

Also, use the following function to remove the read only attribute upon the Form being submitted. 

$(document).on('submit', function(){
    $('#Field').attr('readonly', 'false');
 });

 

Hope this helps!

0 0

Replies

replied on December 8, 2014

Hello! 

Is this field marked as read-only in  the form?

Fields that are marked as read-only and then filled using JavaScript will not show a value when submitted to the repository. This is because Forms thinks that the field is being populated unsecurely. If you would like to have to field be both read-only and filled via JavaScript, set the read-only field attribute using JavaScript rather than in the field's edit mode. 

0 0
replied on December 9, 2014

Hi Kathryn

 

Thanks for direction....

 

Yes, we have set the field to read-only to block users from changing the time.    I am not a Java programer and I do struggle to find scripts when needed.... If you had an java-script example I would appreciate...

cheers

0 0
replied on December 10, 2014

Hi Farzali,

 

This line of code should work! Just insert the field you wish to target. 

 $('#Field').attr('readonly', 'true');

replied on December 10, 2014

Hi Farzali,

 

This line of code should work! Just insert the field you wish to target. 

 $('#Field').attr('readonly', 'true');

0 0
replied on December 10, 2014

Thanks a lot for your help   .... 

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

Sign in to reply to this post.