I have my_string of my_text_field (but its hidden), for example, FRANCE USA_ILANDS GERMANY (space between these each country / words.....actually, all these country names are NAMES of text fields/drop-downs/check boxes on my_form) like that i am concatenating around 200 countrries, well.
Now, i want to search for a match in my_string, say for example, am looking to search for a match of USA, so i put the below JS,
var myCountryName = /USA/;
var returnValue = my_text_field.search(myCountryName);
if(returnValue != -1){; // This Country/field/object is found in the my_text_field, hence greyed out with readOnly
this.ui.oneOfChild.border.fill.color.value = "192,192,192";
this.access = "readOnly";
};
I am expecting the return value should be false.
But, its coming as true!
https://stackoverflow.com/questions/447250/matching-exact-string-with-j avascript
Am following the first suggested option with place holders like, var r = /^a$/ its working fone for me
Pls. let me know is this is safe? ok? recommendabale? or Any other help to find out exact match word?
Thank you