I try to create a writeable PDF form using Acrobat Pro DC. I want to validate that an entry is finishing with a right suffix (XXYY). If it is not, I want an alert to pop up with the message, "Fullfill with the right license XXYY."
Using the helpful message How to validate PDF form?, I have written the following code :
if ( EndsWith(event.value) != "XXYY"){
event.rc = false;
app.alert({
cMsg: "Fullfill with the right license XXYY",
cTitle: "My Window Title",
nIcon: 0,
nType: 1
});
}
But it does not work in pdf form : using debugger, I receive the message "TypeError: EndsWith is not a function".
What could I do to improve the code?