Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn more

View all

Sign in to view all badges

SOLVED

Saving enhanced reader rights saves date

mdawn50
Level 7
Level 7

I have a script to insert the current day's date in a form. When I save the form with enhanced reader rights, it of course saves that day's date. Is there a way to add the enhanced readers rights and still have the script work to fill  in the current day's date for the end user?

Thanks,

MDawn

1 Accepted Solution
radzmar
Correct answer by
Level 10
Level 10

Hi,

you can solve this problem.

1. Wrap your date script in an if/else expression - this is a FormCalc example:

if ($.rawValue == null)then

     $.rawValue = Num2Date(date(), "DD.MM.YYYY")

else

     $.rawValue

endif

2. Before you Reader enable the form, clear the field. It will stay blank because of the if/else expression.

If your field it readOnly or protected, you need to use the JS console to clear the field. - this is an sample to access the "dateField1" under Form1.Page1.Subform1.

     this.xfa.form.Form1.Page1.Subform1.dateField1.rawValue = null;

View solution in original post

2 Replies
radzmar
Correct answer by
Level 10
Level 10

Hi,

you can solve this problem.

1. Wrap your date script in an if/else expression - this is a FormCalc example:

if ($.rawValue == null)then

     $.rawValue = Num2Date(date(), "DD.MM.YYYY")

else

     $.rawValue

endif

2. Before you Reader enable the form, clear the field. It will stay blank because of the if/else expression.

If your field it readOnly or protected, you need to use the JS console to clear the field. - this is an sample to access the "dateField1" under Form1.Page1.Subform1.

     this.xfa.form.Form1.Page1.Subform1.dateField1.rawValue = null;

View solution in original post