Copy link to clipboard
Copied
I have created a pdf form which I am trying to validate the user is entering a correct email address by reqyesting the user enter the email address twice.
What formula do I use to validate that the two fields are the same?
Thanks
Copy link to clipboard
Copied
Compare the values of the two fields.
Copy link to clipboard
Copied
on the properties of the second field under 'confirmation' check the 'run custom validation script' and enter the following:
//enter name of the 'original field'
var f = this.getField("Name_emailfield");
if (event.value == f.value){
//field has same value as 'original field',approve
event.rc = true;
}else{
//field doesnt have same value,deny and dostuff?
event.rc = false;
// give warning(this is a popup but you can aslo show field with red warnings or w/e/)
app.alert("Entered e-mail adres does not match",1);
}
Copy link to clipboard
Copied
That would still allow the user to go back to the first field and change it without triggering an error... You should apply the same code there, too.
Copy link to clipboard
Copied
Wouldn't the check fail each time due to the event.rc=false trigger triggering when the other field is empty?
Might be easyer to make a calculated third field that compares them and shows a warning underneath the input fields