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

Validating Fields Before Locking

New Here ,
Feb 22, 2018 Feb 22, 2018

Copy link to clipboard

Copied

Hi there

Hoping that someone cleverer than I might be able to help me out!

I’m designing a form for a client who has issues with users ‘writing over’ previously completed forms to save them time, but this is causing input errors because they dont check all the fields properly.

To help combat this, I’ve suggested using a Submit Button which once clicked, makes all the user input fields Read Only, before it submits the form via email. This way, users can still save the completed form for their records, but will need to refer back to a blank template to produce a new form for submission.

I’ve got this working nicely using the following script as a Mouse Up event:

this.getField(“il”).readonly = true ;

However, the problem is that form has some mandatory fields which the Submit function obviously validates before it attaches to email, which is great, but if a user misses a mandatory field they can’t go back and correct it because the fields have now become read only!

Changing the order of scripts (both Mouse Up events) to Submit a Form THEN run a script doesn’t fix it, unfortunately.

Is there any way of essentially coding the above script to only run if mandatory field validation is successful, and abandon it if not?

Many thanks in advance!

TOPICS
Acrobat SDK and JavaScript

Views

140

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
no replies

Have something to add?

Join the conversation