• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

pdf form validatation formula

New Here ,
Jul 22, 2020 Jul 22, 2020

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

TOPICS
PDF forms

Views

329

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 22, 2020 Jul 22, 2020

Copy link to clipboard

Copied

Compare the values of the two fields.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jul 23, 2020 Jul 23, 2020

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);
}

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 23, 2020 Jul 23, 2020

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jul 26, 2020 Jul 26, 2020

Copy link to clipboard

Copied

LATEST

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines