Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to compare string in a case-insensitive manner using JavaScript?

843835Jul 1 2003 — edited Jul 1 2003
Hello 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
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 29 2003
Added on Jul 1 2003
3 comments
198 views