How to check for a phrase on a string using scripts in events
eg. I have a text box and I have to validate a particular text is not entered on the input. Can you provide me with how to look for in the onChange event?
I should not allow Hello, if Hello is entered I will alert the user.
Text : ” Hello! welcome world.”
If above is user input I have to throw an alert to the user, as t contains <Hello>
Thanks in advance.
thanks all.. here is the solution i attempted
to achieve the same. Thanks.
The Text control provides the context variables newText and oldText to the On Change event.
You may wish to try using the On Input event with the context variables of current and potential.
Please see our article on the Text control indicating which context variables are available to each event:
As for the method to check for position of the first occurrence of a specified value in a string, please see the following article: