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

Script Help - CONDITIONAL -

Avatar

05-02-2009

hello, I have a problem because I'd like to put a conditional sentence:

"if "TEXT FIELD NO1" = "MARK ANTHONY" then "TEXT FIELD NO2" = "43555668D"

I've got a "drop down list" and I want to set a value if a text field says something or a different value if the text field says something different.

How can I do this??



thanks

regards

Replies

Avatar

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

611 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

611 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

09-02-2009

I will use Javascript for my example. On the exit event of textField1 you could use code something like this:



if (this.rawValue == "MARK ANTHONY") {

TextField2.rawValue = "43555668D"

} else {

TextField2.rawValue = ""

}

Avatar

09-02-2009

THX, it worked for me even with FormCalc. I was wrong because I used = instad of ==

Avatar

Avatar
Validate 1
Level 1
SreeHarshavardh
Level 1

Likes

0 likes

Total Posts

13 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile

Avatar
Validate 1
Level 1
SreeHarshavardh
Level 1

Likes

0 likes

Total Posts

13 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile
SreeHarshavardh
Level 1

07-01-2010

Hi All,

I have an small issue with respect to reading XML Datasource node. Initially I had done the same thing using the Dropdown list box change event by using the below code:

-------

var stateDataNode = $record.resolveNode("StatesAndCities.SAPDetails.(SAPCode.value == " + this.boundItem(xfa.event.change) + ")");

-------

Now I have requirement as the selecting the nodes from same XML Datasource based on the value entered in the TextField. So, I am using the below code in the 'Exit' event of the TextField to accomplish but it's not working. I am using this code in FormCalc :

-------

var stateDataNode = $record.resolveNode("StatesAndCities.SAPDetails.(SAPCode.value == " + this.rawValue + ")");
-------

Using the this.rawValue I am able to read the value in MessageBox, but not in the above code.

So, I am looking for the further help you guys. Please help regarding this.

Regards!

Sree Harshavardhana

Avatar

Avatar
Validate 1
Level 2
AKloft
Level 2

Likes

6 likes

Total Posts

122 posts

Correct Reply

5 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
Applaud 5
View profile

Avatar
Validate 1
Level 2
AKloft
Level 2

Likes

6 likes

Total Posts

122 posts

Correct Reply

5 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
Applaud 5
View profile
AKloft
Level 2

11-01-2010

I believe you need to use the dropdown's newText or some property like that in order to access it's new value.  this.rawValue on a Change event will get you what it previously was...to use rawValue, you could put the code in the exit event instead of the change event, or as I stated previously, using the newText attribute

Avatar

Avatar
Validate 1
Level 1
SreeHarshavardh
Level 1

Likes

0 likes

Total Posts

13 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile

Avatar
Validate 1
Level 1
SreeHarshavardh
Level 1

Likes

0 likes

Total Posts

13 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile
SreeHarshavardh
Level 1

11-01-2010

Dear AK,

Thanks!

As you said, I have my code with in the Exit event of the TextField itself and even I tried to use the newText property of the TextField but no luck!!!

Any other thoughts?

Regards.