Searching text field using script with wild card, key words, or not exact words
Hi,
I'm trying to come up with a script that searches two different text field with words (in this case a location/place) and yields a result (mileage). ex. if text field 1 contains XXX and text field 2 contains XXX then it equals XXX
So far, I was able to somehow come up with the following:
if(this.getField("PlaceRow1").value=="Cape Spencer" && this.getField("PlaceRow2").value=="Sitka"){event.value="320 miles"}
The script works but the downside is that it only works with "exact words and it is also case sensitive" which will not work out since not everyone will type how I have it recorded.
How do I change the above script so that it will not be case senstiive or doesn't follow exact wording?
For example, if they type SITKA, the script will still recognize it as Sitka and if they type just Spenc, it will work with Cape Spencer.
Note: I have ZERO experince with scripting, I was just lucky that the above script happened to partially worked out from all the things I've read. If possible, may you please kindly make it as simple as possible for me to understand. Thank you so much in advance.
