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

Form Validation pop up menu formatting...

Engaged ,
Dec 23, 2016 Dec 23, 2016

I have made one form which requires validation before signing....... everything is working good........ clicking validation button pops up a message about which fields need to be filled (if any require fields are not filled by user)..

Now i want to ask is it possible in pdf form that instead of pop up message..... the fields which are not filled by users are highlighted in red there itself instead of a popup message (bcoz the formatting of pop up is very bad and i am not able to format the popup mssg.. they come up very messy).

TOPICS
Acrobat SDK and JavaScript , Windows
498
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 ,
Dec 23, 2016 Dec 23, 2016

There are three colors that you can set for a field:

1. text color

2. background color

3. border color

When you have the "highlight fields" function active, the background color will only be shown when your field is active (because only one field can be active at any time, only one field would show your "this field needs to be filled out" color). I usually change both the border color and the highlight color, so even with the highlight function being active, the border color would still show.

You can change the border/background color via the Field.strokeColor and Field.fillColor properties. In your validation script, you would access these via the "event.target" property:

if (something == true) {

  event.target.fillColor = color.red;

  event.target.strokeColor = color.red;

}

else {

  event.target.strokeColor = color.green;

  event.target.fillColor = color.green;

}

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
Engaged ,
Dec 23, 2016 Dec 23, 2016

I was not looking for something  this

validation-main.png

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
Engaged ,
Dec 23, 2016 Dec 23, 2016

i mean i was actually looking like the image in the above post...... if validation fails then such mssg should appear above or below the field

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 ,
Dec 23, 2016 Dec 23, 2016
LATEST

In that case, you have to add a read-only field that you show/hide depending on the state of your actual (validated) field. You do this via the Doc.display property: Acrobat DC SDK Documentation

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