Skip to main content
jnix612
Inspiring
June 26, 2017
Answered

Show error message for incorrect entry

  • June 26, 2017
  • 1 reply
  • 572 views

SHORT QUESTION:

Can PDF Forms show an error box alerting the person filling out the form they can't select the same option in question (field) 2 as they did for question (field) 1?

DETAILS IF THE ABOVE LACKS ENOUGH INFO:

My form ask:

  1. Question 1: What STOP position are you applying for? They have 3 choices.
  2. Question 2: Do you have additional experience bla bla? They have the same 3 choices as question 1, however they are not reading the full instructions and if they are applying for Field Epidemiology in question 1, they tell me they have additional experience in the exact same field.
This topic has been closed for replies.
Correct answer try67

Yes, it's possible. It's even possible to reject that new value.

The code for it would be something like this (to be used as the custom validation script of the second field):

if (event.value!="" && event.value==this.getField("Field1").valueAsString) {

     app.alert("You already selected this value before.", 1);

     event.rc = false;
}

1 reply

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
June 26, 2017

Yes, it's possible. It's even possible to reject that new value.

The code for it would be something like this (to be used as the custom validation script of the second field):

if (event.value!="" && event.value==this.getField("Field1").valueAsString) {

     app.alert("You already selected this value before.", 1);

     event.rc = false;
}

jnix612
jnix612Author
Inspiring
June 26, 2017

Great! Thank you. Tomorrow I will put it to test.