I have a FORM which has a text box in a for loop .
I'm having little difficulity in reading what is inside the "NM" Input text box so that i can do some validation .
This is what i have in the validate() function .
I'm able to read only a3[0] and not a3[1] .
But if i submit this to the next ASP Page i'm able to read everything but not in the same ASP Page in javascript function .
Please let me know where i'm doing wrong .
Thanks!!!!
Code:
<form name="form1" method="POST" Action="sasd.asp" onSubmit="return validate();">
<%
for(i=0;i <3;i++)
{
%>
<input width="150" Type="text" name="NM">
<%
}
%>
</FORM>
I'm having little difficulity in reading what is inside the "NM" Input text box so that i can do some validation .
This is what i have in the validate() function .
Code:
var a1=document.form1.elements[1].value;
var a2=a1+'';
var a3=a2.split(",");
alert(a3[0]+a3[1]);
But if i submit this to the next ASP Page i'm able to read everything but not in the same ASP Page in javascript function .
Please let me know where i'm doing wrong .
Thanks!!!!