Copy link to clipboard
Copied
I want to pre-populate a text field (Hiring Salary Range) based on the drop-down choice (Pay Grade) and radio button choice (Exempt/Non-Exempt). Please help!
You can use something like this as the custom calculation script of that field (adjust the values as needed):
var payGrade = this.getField("Pay Grade").valueAsString;
var exempt = this.getField("Exempt").valueAsString;
if (payGrade=="1" && exempt=="Exempt") event.value = 1000;
else if (payGrade=="1" && exempt=="Non-Exempt") event.value = 1200;
else if (payGrade=="2" && exempt=="Exempt") event.value = 2000;
else if (payGrade=="2" && exempt=="Non-Exempt") event.value = 2400; // etc.
else event.
...
You have to put quotes around strings, such as: "$24,774 - $37,161"
Copy link to clipboard
Copied
in the future, to find the best place to post your message, use the list here, https://community.adobe.com/
p.s. i don't think the adobe website, and forums in particular, are easy to navigate, so don't spend a lot of time searching that forum list. do your best and we'll move the post (like this one has already been moved) if it helps you get responses.
<"moved from using the community">
Copy link to clipboard
Copied
assuming this is an acrobat question.
Copy link to clipboard
Copied
You can use something like this as the custom calculation script of that field (adjust the values as needed):
var payGrade = this.getField("Pay Grade").valueAsString;
var exempt = this.getField("Exempt").valueAsString;
if (payGrade=="1" && exempt=="Exempt") event.value = 1000;
else if (payGrade=="1" && exempt=="Non-Exempt") event.value = 1200;
else if (payGrade=="2" && exempt=="Exempt") event.value = 2000;
else if (payGrade=="2" && exempt=="Non-Exempt") event.value = 2400; // etc.
else event.value = "";
Copy link to clipboard
Copied
I could not get the checkboxes to work, so I changed them to drop-down lists. Following this as a guide, I created this string, which is not working:
var PayGrade = this.getField("Pay Grade").valueAsString;
var Status = this.getField ("Status").valueAsString;
var Hours = this.getField("Hours").valueAsString;
if (PayGrade=="57"&& Status=="Exempt" && Hours=="Full-Time")event.value = $24,774 - $37,161; else if (PayGrade=="57"&& Status=="Non-Exempt" && Hours== "Full-Time")event.value = $11.91 - $17.87; else event.value = "See Attached";
It tells me there is a syntax error missing before statement 7: at line 8.
I am adding this script in the "Custom calculation script" field under the "Calculate" tab in the Properties of the field where I want the result.
Basically, I have a list of Pay Grades, that have different Salary Ranges based on full-time or part-time. I'm trying to auto-populate the Salary Range field based on the answers of the 3 drop downs - Pay Grade, Status, and Hours.
I think I'm close, but it's not quite there yet...
Suggestions?
Copy link to clipboard
Copied
You have to put quotes around strings, such as: "$24,774 - $37,161"
Copy link to clipboard
Copied
Thanks so much for your quick response. It worked perfectly!!
Copy link to clipboard
Copied
One more question...
If they choose "Exempt" under Status, can I force "Hours" to auto-populate with "Full-Time", thereby auto-populating "Salary Range"?
Copy link to clipboard
Copied
I figured it out - you have been a great guide!