Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Issue with getting a drop down to pre-populate text fields

Avatar

21-09-2015

Hi

I have a form where I want to populate a couple of fields when an option from a drop down is selected.

My column headers are

Product (This is the dropdown)

Description

Item Code

I found some code on these forums from a similar query and have popped it in but Im not sure if Im doing it right as I am getting errors.

Should I be selecting 'change' under show?

The code I have used is:

var sNewSel = event.value;

     switch (sNewSel) {

       case "Scott Slimroll Hand Towel Roll":

         this.getField("Description").value = "Scott Slimroll Hand Towel Roll - 1ply - White";

         this.getField("ItemCode").value = "PTKCSLHTROL1P-W";

         break;

     case "Scott 36 Folded Toilet Tissue":

         this.getField("Description").value = "Scott 36 Folded Toilet Tissue 36 x 100";

         this.getField("ItemCode").value = "PTKCSCTTIS2P-W";

         break;

     }

I have Commit on Select selected

Whats gone wrong?? The error I get is:

adobe issue.PNG

Accepted Solutions (0)

Answers (1)

Answers (1)

Avatar

Avatar
Springboard
MVP
Magus069
MVP

Likes

143 likes

Total Posts

1,077 posts

Correct Reply

155 solutions
Top badges earned
Springboard
Validate 1
Ignite 3
Ignite 1
Establish
View profile

Avatar
Springboard
MVP
Magus069
MVP

Likes

143 likes

Total Posts

1,077 posts

Correct Reply

155 solutions
Top badges earned
Springboard
Validate 1
Ignite 3
Ignite 1
Establish
View profile
Magus069
MVP

21-09-2015

Hi there,

in FormCalc, the statement 'switch' is not available, you would have to use if statements.

Make sure to use the FormCalc references manual to help you..

http://help.adobe.com/en_US/livecycle/es/FormCalc.pdf

Otherwise you can use the switch statement within JavaScript