I need help on checking a certain word if it contains in a
string that is being assigned into my input textbox.
For example below, If
there's a string value assigned to this
textbox
id="StartLocation" name="StartLocation" value="1 AAC, MT SECTION, RAF SCAMPTON, LINCOLN,
LN1 2ST, UNITED KINGDOM"
>
I want
to check if it contains the word "UNITED KINGDOM" and if
does not, it should return false.
I tried something like this below but it
keeps returning true because the alert message is always 'It contains United Kingdom'
even though I already
change the value.
if
($("input#StartLocation:contains('UNITED KINGDOM')")) {
alert('It contains
United Kingdom');
} else {
alert('It does not contains United
Kingdom');
}
How
do I fix this? Thanks...
No comments:
Post a Comment