Script for contains?
Is there a script to check if a textfields rawValue contains specific text?
For example: If the rawValue is John Smith
can I script to test of the rawValue contains "Smith"?
Is there a script to check if a textfields rawValue contains specific text?
For example: If the rawValue is John Smith
can I script to test of the rawValue contains "Smith"?
yep! Javascript has one built in: string.search()
Here's an example:
if (TextField1.rawValue.search("the") != -1) TextField2.rawValue = "yes";
else TextField2.rawValue = "no";
http://www.w3schools.com/jsref/jsref_search.asp
Message was edited by: jasotastic81 added external link to w3's site.
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.