Tuesday, July 6, 2010

Compare multiple TextField through javascript

this code not allow the same text in any two text field

function comp_txt(present)
{
dml=document.forms['aspnetForm'];
var i;
var per=document.getElementById(present);
for(i=0;i {
if(per.name == dml.elements[i].name)
{
}
else if(per.value == dml.elements[i].value)
{
per.value="";
}
}
}



you can call on onChange event and pass argument id of current

text field

No comments:

Post a Comment