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

New Here ,
Jul 15, 2020 Jul 15, 2020

Copy link to clipboard

Copied

Hi There

 

I have created this validation Screen Shot 2020-07-15 at 19.14.35.png 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!

Screen Shot 2020-07-15 at 19.19.30.png

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.

 

TOPICS
Acrobat SDK and JavaScript, Edit and convert PDFs, PDF forms

Views

27

Likes

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 1 Correct Answer

New Here , Jul 16, 2020 Jul 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...

Likes

Translate

Translate
New Here ,
Jul 16, 2020 Jul 16, 2020

Copy link to clipboard

Copied

LATEST
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:

Likes

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