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

Validating one Field from Another

New Here ,
Sep 27, 2016 Sep 27, 2016

Greetings! and thanks for any input.

I have a text field being validated based on two other fields and a checkbox - if the box is checked, the input is compared to the first field; if it is unchecked, the input is compared to the other field instead. I've coded this and it's working perfectly.

What I'd like to do is have the field re-validated when the checkbox is clicked, so that the effect of the checkbox on the validation is immediate rather than the field itself having to be changed again. Is there a way to do this?

Hope my explanation is clear enough. Thanks again!

TOPICS
Acrobat SDK and JavaScript , Windows
294
Translate
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 ,
Sep 27, 2016 Sep 27, 2016

You'll need to either use a separate field to perform the validation (for example, in the calculation script of a hidden text field), or duplicate (and slightly modify) your code so that it also executes when the MouseUp event of the check-box is triggered.

Translate
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
LEGEND ,
Sep 27, 2016 Sep 27, 2016
LATEST

You can either add some code to the Mouse Up event of the check box or you can set up a hidden text field and set up a custom calculation script, which could do the job of validating the other text field. The main difference is the check box script will get triggered whenever its value is changed, and the calculation script will be triggered whenever any field value changes.

Translate
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