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

app.alert still shows after age is entered.

Community Beginner ,
Feb 21, 2023 Feb 21, 2023

Copy link to clipboard

Copied

Once a checkbox have been checked, an alert message will appear if the age field is empty. 

Click "OK", then setFocus on age field.

After I enter the age and click out of the age box, the message still appears another time, as if the value hasn't been committed yet.

How do I show the message only once?

 

if (getField("Run").value == "1")
{

if (this.getField("MaxHR").value == "")

app.alert("Please enter patient's age or Date of Birth!",3);

getField("age").setFocus();

}

}

 

TOPICS
Acrobat SDK and JavaScript

Views

265

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

correct answers 1 Correct answer

Community Expert , Feb 21, 2023 Feb 21, 2023

You are using two different fields, "MaxHR" and "age". Even if you fill "age" field alert will pop as long as "MaxHR" is empty. Change "MaxHR" to "age".

Votes

Translate

Translate
Community Expert ,
Feb 21, 2023 Feb 21, 2023

Copy link to clipboard

Copied

You are using two different fields, "MaxHR" and "age". Even if you fill "age" field alert will pop as long as "MaxHR" is empty. Change "MaxHR" to "age".

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
Community Beginner ,
Feb 21, 2023 Feb 21, 2023

Copy link to clipboard

Copied

LATEST

How silly of me.

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