How to compare string in a case-insensitive manner using JavaScript?
843835Jul 1 2003 — edited Jul 1 2003Hello everyone,
Now I have a javascript to compare checkbox's value with user's input, but now seems it only can compare case-sensitively, does some one know if there is a function in javascript that it can compare string case-insensitively ?
Here is my script :
function findOffice(field)
{
var name;
name=prompt("What is the office name?");
var l = field.length;
for(var i = 0; i < l; i++)
{
if(field.value==name)
{
field[i].checked=true;
field[i].focus();
field[i].select();
break;
}
}
}
<input type="button" name="Find" value="Find And Select" onClick="findOffice(form1) >
Thanks in advance !
Rachel