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

Dropdown list populates Textfield based on Numeric field data!

Avatar

Avatar
Level 1
_Allen_Botello_
Level 1

Likes

0 likes

Total Posts

5 posts

Correct Reply

0 solutions
View profile

Avatar
Level 1
_Allen_Botello_
Level 1

Likes

0 likes

Total Posts

5 posts

Correct Reply

0 solutions
View profile
_Allen_Botello_
Level 1

25-02-2009

How do I get the exit data in NumericField9 to auto-populate the text for TextField13 based on the DropDownList5 selection?

The ideal flow would be; (1) DropDownList5 selection (2) NumericField9 data entered (3) Textfield13 auto-populated text.



My current code below almost gets me there. After the DropDownlist is selected it populates TextField13 with "no benefits". I then have to re-select the DropDownList selection for the proper TextField13 autopopulation after NumericField9 has been filled in.



1. Drop Down list 5

else if ( xfa.event.newText == "Research Scientist I-F" )

{

DropDownList8.clearItems();

DropDownList8.addItem("000001");

TextField16.rawValue = "NOT ELIGIBLE";

TextField13.rawValue = "Manager Benefits";

var total = ( NumericField9.rawValue );

{

if ( total > 0.89 )

TextField13.rawValue = "Faculty Benefits";

if ( total < 0.90 )

TextField13.rawValue = "Manager Benefits";

if ( total < 0.50 )

TextField13.rawValue = "PTO/ESL";

if ( total < 0.25 )

TextField13.rawValue = "No Benefits";

}

}



2. Number field 9

form1.#subform[6].NumericField9::exit - (JavaScript, client)

if ( this.rawValue > 1 ) this.rawValue /= 100;



3. Text Field 13

form1.#subform[6].TextField13::change - (JavaScript, client)

Replies

Avatar

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

612 likes

Total Posts

7,689 posts

Correct Reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

612 likes

Total Posts

7,689 posts

Correct Reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile
pguerett
Level 10

25-02-2009

Use the Calculate event on Textfield 9 so that when it changes it will do its calc and update field13.

Avatar

Avatar
Level 1
_Allen_Botello_
Level 1

Likes

0 likes

Total Posts

5 posts

Correct Reply

0 solutions
View profile

Avatar
Level 1
_Allen_Botello_
Level 1

Likes

0 likes

Total Posts

5 posts

Correct Reply

0 solutions
View profile
_Allen_Botello_
Level 1

25-02-2009

Ok, I will try this. Please advise on the code. What code should I put in the "numericField9" under the Calc event to reference the DropDownList5 selection, so that the proper text field can be displayed.

OR

Should I post the text field reference in the numericfield9 so that it can identify, which dropdown5 selection has occured to autopopulate the textfield13. Please give an example of code to use.

Avatar

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

612 likes

Total Posts

7,689 posts

Correct Reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

612 likes

Total Posts

7,689 posts

Correct Reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile
pguerett
Level 10

25-02-2009

To reference the DDlist5 you should be able to use DropDownList5.rawValue.



The code shoudl be something like this:



Textfield13.rawValue = DDList5.rawValue + TextField9.rawValue

Avatar

Avatar
Level 1
_Allen_Botello_
Level 1

Likes

0 likes

Total Posts

5 posts

Correct Reply

0 solutions
View profile

Avatar
Level 1
_Allen_Botello_
Level 1

Likes

0 likes

Total Posts

5 posts

Correct Reply

0 solutions
View profile
_Allen_Botello_
Level 1

25-02-2009

I figured it out on my own....All I had to do was identify the "exit" response on each possible DropDownList selection for auto populating the text field. Code as follows:



form1.#subform[6].NumericField9::exit - (JavaScript, client)

if ( this.rawValue > 1 ) this.rawValue /= 100;

else if ( DropDownList5.rawValue == "Research Scientist I-F" );

var total = ( NumericField9.rawValue );



{

if ( total > 0.89 )

TextField13.rawValue = "Manager Benefits";

if ( total < 0.90 )

TextField13.rawValue = "Manager Benefits";

if ( total < 0.50 )

TextField13.rawValue = "PTO/ESL";

if ( total < 0.25 )

TextField13.rawValue = "No Benefits";

}



else if ( DropDownList5.rawValue == "Research Scientist II-F");

var total = (NumericField9.rawValue );



and so on.....it goes like the one above....Good Luck with this and I hope it helps someone else.---Allen