Skip to main content
Participating Frequently
May 7, 2020
Answered

Java script Help!

  • May 7, 2020
  • 1 reply
  • 2147 views

I'm trying to create a format for a field in my PDF.

 

Custom Format Script:

event.value="/" +event.value + "/";

 

Custom Keystroke Script:

event.rc = /^[A-Z]*$/.test
(event.change);

 

I'm hoping the outcome that the what ever is entered in this field starts with "/" and ends "/". - when testing for e-sign, it did not warn the signor to use the "/" and "/" and they were able to move to hte next field and sign the document.

 

How can build this script to make it a requirement?

This topic has been closed for replies.
Correct answer try67

I meant, do I remove the format script and put that in the validation?*


Yes, remove that script and add this one instead:

if (event.value) event.value = "/" + event.value.replace(/^\//, "").replace(/\/$/, "") + "/";

1 reply

try67
Community Expert
Community Expert
May 7, 2020

Do you want the field value to actually have those characters in it, or just to appear as if it does?

If the former then using the Format event will not achieve that. You can use the Validation event to force it.

NDAQAuthor
Participating Frequently
May 7, 2020

I want the field to actually have those characters.  Would I get rid of teh keystroke script and add that to the validation?

 

 

NDAQAuthor
Participating Frequently
May 7, 2020

I meant, do I remove the format script and put that in the validation?*