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

Switch - using another fields rawValue

Avatar

Avatar
Validate 10
Level 2
legallogic-DqvA
Level 2

Likes

0 likes

Total Posts

89 posts

Correct Reply

2 solutions
Top badges earned
Validate 10
Validate 1
Affirm 1
View profile

Avatar
Validate 10
Level 2
legallogic-DqvA
Level 2

Likes

0 likes

Total Posts

89 posts

Correct Reply

2 solutions
Top badges earned
Validate 10
Validate 1
Affirm 1
View profile
legallogic-DqvA
Level 2

26-01-2010

Hi,

Ive got the below code on a fields (not the worktype dropdown list's field) and want to use a switch statement to combine a variable and this fields rawValue with the variable being combined depending on the rawValue of the dropdown list - (the code below is commented to clarify what im trying to do)

anyone know why this isn't working.....

// this code is attached to the exit event a field called employname (the next field the user completes after the worktype list selection)  

switch (worktype.rawValue)

case "1": {

//where the "1" is the rawValue of the worktype dropdown list following selection by user

page3.para5.rawValue = f1.value + this.rawValue +".";

}

         break;

case "2": {

page3.para5.rawValue = f1.value + this.rawValue +"222222.";

}

        break;

case "3": {

page3.para5.rawValue = f1.value + this.rawValue +"3333";

}}
thanks folks

View Entire Topic

Avatar

Avatar
Validate 1
Level 9
Steve_L_Walker
Level 9

Likes

197 likes

Total Posts

1,435 posts

Correct Reply

212 solutions
Top badges earned
Validate 1
Boost 50
Boost 5
Boost 3
Boost 25
View profile

Avatar
Validate 1
Level 9
Steve_L_Walker
Level 9

Likes

197 likes

Total Posts

1,435 posts

Correct Reply

212 solutions
Top badges earned
Validate 1
Boost 50
Boost 5
Boost 3
Boost 25
View profile
Steve_L_Walker
Level 9

26-01-2010

What is not working? The assignment to "page3.para5.rawValue"? Do you want to concatenate strings together or do addition?

The code below was attached to the exit event on drop-down "dropDown1". It concatenates the value of "dropDown1" with the value of "textField1" and populates "textField2".

// form1.page1.dropDown1::exit - (JavaScript, client)

switch (this.rawValue) {

     case "1":

          form1.page1.textField2.rawValue = this.rawValue + form1.page1.textField1.rawValue;

          break;

     case "2":

         form1.page1.textField2.rawValue = this.rawValue + form1.page1.textField1.rawValue;

         break;

     case "3":

         form1.page1.textField2.rawValue = this.rawValue + form1.page1.textField1.rawValue;

         break;

     default:

         break;

}