Skip to main content
Participating Frequently
October 26, 2024
Question

Dependant drop down script help

  • October 26, 2024
  • 3 replies
  • 1022 views

Hi, I am trying to create a form with 3 drop downs.

 

 

 

The first drop down is "Court Type" - Magistrates, County etc

 

The second is "Court location" - Melbourne, Geelong etc

 

The 3rd is 'Fee Type' - Magistrates - Bail $456, Plea $880, County Bail $880, Plea $1200

 

What I would like is if the court type is selected, the relevant court location appears in the drop down (I have got this script right)

 

But then I would like the relevant fee type to appear in the 'fee type' drop down. I cannot work it out....

 

HELP!!!

 

 

This topic has been closed for replies.

3 replies

try67
Community Expert
Community Expert
October 26, 2024

Under the "Magistrates" case you can add something like this, then:

this.getField("Fee Type").setItems(["Bail $456", "Plea $880", "County Bail $880", "Plea $1200"]);

Nesa Nurani
Community Expert
Community Expert
October 26, 2024

So you already have script for "Court Location" just use same script for "Fee Type",
in the first line, change field name from: var f = this.getField("Court Location");
to: var f = this.getField("Fee Type");
then change cases to cases you will have in "Fee Type" and setItems() to the items you wish in "Fee Type".
Place the script in "Court Location" field.

Participating Frequently
October 27, 2024

Its still not working, If I do put that script in the Court Location box, there is no drop down option in the fee type, it's blank. Could it have something to do with the fee type drop down and the court location drop down both being reliant on the selected option from court type? The fee type drop down is not reliant on the court location and vise versa

Nesa Nurani
Community Expert
Community Expert
October 27, 2024

Post the script you tried to use in "Court Location" (not photo of the script)

PDF Automation Station
Community Expert
Community Expert
October 26, 2024

Are you trying to change the dropdown selection options,  or display a specific selection int he dropdown?

Participating Frequently
October 26, 2024

A bit of both. I want the fee type drop down list to change based on the court type selection. So, if someone selects magistrate's court, only the magistrate court specific fees can be selected, if someone selects county court only county court fees can be selected and so on . 

Participating Frequently
October 26, 2024

But the court location can't be impacted by the fee type selection