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

Alert based on drop down selection

Engaged ,
Dec 09, 2020 Dec 09, 2020

Copy link to clipboard

Copied

Really hoping I can get some help with this.  I attached an example of what I need.  If the user enters the hours FIRST in the RegHrs1 text field and then selects CDO (compressed day off) from the AbsencePayTypeDesc1 dropdown list, can an alert pop up that tells the user 'Do not enter hours' BUT if the user does NOT enter hours and then selects CDO (compressed day off) I don't need an alert to pop up.  Thank you!

Views

632

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 2 Correct answers

Community Expert , Dec 09, 2020 Dec 09, 2020

I answerd you on your other post.

Try this file and let me know if thats what you need.

https://drive.google.com/uc?export=download&id=160hb6cB1jtNGXdwXIa9v3E449gxQS4-2 

Votes

Translate

Translate
Community Expert , Dec 09, 2020 Dec 09, 2020

I also wanted to add what worked for me:

 

I run a custom calculation script from the dropdown menu and deleted the validation scripts from both fields, as I found it wasn't exclusively necessary to use in this case.

 

var regHours = this.getField("RegHrs1");
var f = event.target;

if ( regHours.value !=="") {

if (f.valueAsString == "CDO (compressed day off)") { app.alert("Do Not Enter Hours", 0);
//regHours.value = "";
this.resetForm(["RegHrs1"]);
} else {

if ( regHours.value == "" && f.value
...

Votes

Translate

Translate
Community Expert ,
Dec 09, 2020 Dec 09, 2020

Copy link to clipboard

Copied

I answerd you on your other post.

Try this file and let me know if thats what you need.

https://drive.google.com/uc?export=download&id=160hb6cB1jtNGXdwXIa9v3E449gxQS4-2 

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
Engaged ,
Dec 09, 2020 Dec 09, 2020

Copy link to clipboard

Copied

Yes, I saw thank you!  Sorry, I looked at my profile this morning and I couldn't find it.  I thought maybe it disappeared

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
Enthusiast ,
Dec 09, 2020 Dec 09, 2020

Copy link to clipboard

Copied

There is some issue going on with forum where posts keep dissapearing, not sure if it's bug or deliberately.

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
Engaged ,
Dec 09, 2020 Dec 09, 2020

Copy link to clipboard

Copied

I applied to my form and it works exactly how I need it to now.  Thank you so much for your help.  I really apprectiate it!!

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 Expert ,
Dec 09, 2020 Dec 09, 2020

Copy link to clipboard

Copied

I also wanted to add what worked for me:

 

I run a custom calculation script from the dropdown menu and deleted the validation scripts from both fields, as I found it wasn't exclusively necessary to use in this case.

 

var regHours = this.getField("RegHrs1");
var f = event.target;

if ( regHours.value !=="") {

if (f.valueAsString == "CDO (compressed day off)") { app.alert("Do Not Enter Hours", 0);
//regHours.value = "";
this.resetForm(["RegHrs1"]);
} else {

if ( regHours.value == "" && f.valueAsString == "CDO (compressed day off)") { 
event.value = f.value;
  }
 }
}

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
Engaged ,
Dec 09, 2020 Dec 09, 2020

Copy link to clipboard

Copied

Nice!  Thank you very much!  I really appreciate your input!  I'll give it a try.

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
Engaged ,
Dec 09, 2020 Dec 09, 2020

Copy link to clipboard

Copied

LATEST

It works great, thank you!

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