Hello,
I need to compare 2 id names but not their values. For example:
document.getEle mentById(i) == document.getEle mentById(j)
these elements above seem to give error or do not work.
My original statement is this (and note, when I add line above to it,
that does not work):
function uniqueValues(){
var myForm = document.add2db ;
var iMax = myForm.imax.val ue;
//var IsSimilar, IsSame;
for (i=0;i<iMax;i++ )
{
var fieldValue=docu ment.getElement ById(i).value;
alert("id is "+document.getE lementById(i));
for(j=0;j<iMax; j++)
{
var fieldValue2=doc ument.getElemen tById(j).value;
if ((fieldValue == fieldValue2) && (document.getEl ementById(i) !=
document.getEle mentById(j))) { //FIX HERE
alert("I am sorry, but these values are identical:
"+document.getE lementById(j).v alue);
document.getEle mentById(j).foc us();
return false;
}
}
}
//return true;
}
I need to compare 2 id names but not their values. For example:
document.getEle mentById(i) == document.getEle mentById(j)
these elements above seem to give error or do not work.
My original statement is this (and note, when I add line above to it,
that does not work):
function uniqueValues(){
var myForm = document.add2db ;
var iMax = myForm.imax.val ue;
//var IsSimilar, IsSame;
for (i=0;i<iMax;i++ )
{
var fieldValue=docu ment.getElement ById(i).value;
alert("id is "+document.getE lementById(i));
for(j=0;j<iMax; j++)
{
var fieldValue2=doc ument.getElemen tById(j).value;
if ((fieldValue == fieldValue2) && (document.getEl ementById(i) !=
document.getEle mentById(j))) { //FIX HERE
alert("I am sorry, but these values are identical:
"+document.getE lementById(j).v alue);
document.getEle mentById(j).foc us();
return false;
}
}
}
//return true;
}
Comment