|
-
Nov 27th, 2002, 06:30 AM
#1
Thread Starter
Hyperactive Member
Validation of text boxes
In a form I've many controls and some text boxes which I've created on the fly.I have to do a javascript validation so that i dont put duplicate entry in the text boxes which were created on fly. I'm having problem with the syntaxes.
The code i'm writing is something like this..pls help me on this.var index = 1;
obj = document.frmStocks.elements;
icount = obj.length;
for (i = 0; i < icount; i++)
{
if (obj(i).name == 'txtDrum' + index)
{
for (j= 1;j< icount; j++)
{
alert(index);
alert(j);
if (index!=j)
{
/if (obj(index).value == obj(j).value)
//alert("sid" + i);
//alert("sin" + j);
/alert(('txtDrum' + index).value);...this gives //undefined
if ('txtDrum' + index.value == 'txtDrum' + j.value)
{
alert("duplicate");
return false;
}
}
}
index++;
}
}
-
Nov 29th, 2002, 12:30 PM
#2
Hyperactive Member
can u post a link to this page all provide all the code?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|