Skip to main content
New Participant
July 15, 2020
Answered

List powered by validation on another list resets to first value on save?

  • July 15, 2020
  • 1 reply
  • 352 views

Hi There

 

I have created this validation  that runs from a dropdown i.e. North of Tyne, South of Tyne, etc...

When the colleague selects North of Tyne the "Probation Office"  Drop-down Field successfully shows Ashington, Berwick-upon-tweed, Newcastle and Wallsend - So far so good!

However, whenever a colleague selects anything other than "Ashington" and presses save, this field always resets to ashington.

 

It is reverting back to the first value in the dropdown for all of these lists and I wonder if it is due to the validation in the first field or the options in the 2nd field?

 

Thank you so much for your help, I am new to Adobe and this is my first community post.

 

This topic has been closed for replies.
Correct answer JacobHill
if (event.value=="North of Tyne" && this.getField("Probation Office").getItemAt(0) != "Ashington")

this.getField("Probation Office").setItems(["Ashington", "Berwick-upon-Tweed", "Newcastle", "Wallsend"]);

else if (event.value=="South of Tyne" && this.getField("Probation Office").getItemAt(0) != "Sunderland South")

this.getField("Probation Office").setItems(["Sunderland South", "Sunderland North", "Gateshead"]);

else if (event.value=="Sheffield and Barnsley" && this.getField("Probation Office").getItemAt(0) != "Sheffield")

this.getField("Probation Office").setItems(["Sheffield", "Barnsley"]);

else if (event.value=="North East Lincolnshire" && this.getField("Probation Office").getItemAt(0) != "Grimsby")

this.getField("Probation Office").setItems(["Grimsby", "Scunthorpe"]);

else if (event.value=="Doncaster and Rotherham" && this.getField("Probation Office").getItemAt(0) != "Doncaster")

this.getField("Probation Office").setItems(["Doncaster", "Rotherham"]);

else if (event.value=="Hull and East Riding" && this.getField("Probation Office").getItemAt(0) != "Hull")

this.getField("Probation Office").setItems(["Hull", "Beverley", "Goole", "Bridlington"]);

This has now been fixed, using this code:

1 reply

JacobHillAuthorCorrect answer
New Participant
July 16, 2020
if (event.value=="North of Tyne" && this.getField("Probation Office").getItemAt(0) != "Ashington")

this.getField("Probation Office").setItems(["Ashington", "Berwick-upon-Tweed", "Newcastle", "Wallsend"]);

else if (event.value=="South of Tyne" && this.getField("Probation Office").getItemAt(0) != "Sunderland South")

this.getField("Probation Office").setItems(["Sunderland South", "Sunderland North", "Gateshead"]);

else if (event.value=="Sheffield and Barnsley" && this.getField("Probation Office").getItemAt(0) != "Sheffield")

this.getField("Probation Office").setItems(["Sheffield", "Barnsley"]);

else if (event.value=="North East Lincolnshire" && this.getField("Probation Office").getItemAt(0) != "Grimsby")

this.getField("Probation Office").setItems(["Grimsby", "Scunthorpe"]);

else if (event.value=="Doncaster and Rotherham" && this.getField("Probation Office").getItemAt(0) != "Doncaster")

this.getField("Probation Office").setItems(["Doncaster", "Rotherham"]);

else if (event.value=="Hull and East Riding" && this.getField("Probation Office").getItemAt(0) != "Hull")

this.getField("Probation Office").setItems(["Hull", "Beverley", "Goole", "Bridlington"]);

This has now been fixed, using this code: