hello all,
i’ve got an array of states and a textfield for a user to type his/her state and press “search”.
i can trace the array and see all the values and i can trace the textfield value of the user and everything is showing up. but…
i can’t match the user input with the correspoding state in the array. as simple as this is the code below isn’t working:
searcher.srch.onRelease = function() // fires when the search btn is released
{
var s = searcher.userState.text; // user input txtfld
for(var a=0; a<lArray.length; a++) //lArray is the array of states
{
if(s == lArray[a]) // if the user's input matches a value in the array, then...
{
trace("found it!");
}
else
{
trace("not found!");
}
}
}
if i use “==” i get ‘not found’, if i use “=” i get “found it”…regardless of what i search for. i can search for ‘chicken’ and it will find it…which is impossible.
any ideas??
thanks!