Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

170
Views
Set PDF Form field value using a dropdown field, and allow user input in field

I'm creating a PDF form with a dropdown field (called State) with two options "Liquid" and "Dry" and a calculated text field (called Parameter). When State = "Dry" I need Parameter = "Bulk Density". When State = "Liquid" I would like the field Parameter to clear, and then allow user input.

I have this partially working with the following JavaScript entered in the field properties for the Parameter field under the Calculate tab, under Custom calculation script. However, when I select "Liquid" and manually enter data into the calculated field it clears the manually entered data.

var v = this.getField("State").valueAsString;
if (v=="Dry") event.value = "Bulk Density";
else event.value = "";

I was able to use event.rc to stop the calculation and allow user entered data, but I had to remove the else statement. The of course means when the state is switched to "Liquid" the field is not cleared for the user.

var v = this.getField("State").valueAsString;
if (v=="Dry") event.value = "Bulk Density";
event.rc = (v != "");

I've tried putting the event.rc line in the else statement, but it doesn't do anything.

var v = this.getField("State").valueAsString;

if (v=="Dry") {
event.value = "Bulk Density";}
else {
event.value = "";
event.rc = (v != "");
}

What am I missing here to combine these? Any suggestions would be greatly appreciated.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!