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

Check if dropdown contains "-" or something else

New Here ,
Nov 03, 2022 Nov 03, 2022

Copy link to clipboard

Copied

There is a dropdown menu with the following values:

 

- "-"
- value 1
- Value 2
- Value 3

" - " is a default value and is always displayed first
(comparatively with zero)

 

However, a warning should appear as soon as you have not changed the value " - " to "Value 1, 2 or 3" when you save or exit the PDF. But you are not forced to change the value this is only a warning.

 

As a warning should appear: "Please choose a valid value (- is not a valid value)".

 

Thank you very much for the help!

TOPICS
Acrobat SDK and JavaScript , Windows

Views

113

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
New Here ,
Nov 04, 2022 Nov 04, 2022

Copy link to clipboard

Copied

LATEST

Solved it myself 🙂

 

var f = this.getField("Dropdown1");

if (f.valueAsString=="-") {

    app.alert("You must fill in this field before submitting the file.",3);

    f.setFocus();

} else this.mailDoc();

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