<HTML>
<HEAD>
<TITLE>FORMS</TITLE>
<!-- This code allows to access the Form objects Elements Array //-->
<SCRIPT Language="JavaScript">
function Ver(form1)
{
v=form1.elements.length;
if (form1.elements[3].name=="Button1")
{
alert('First form name : '+document.forms[0].name);
alert('No. of Form elements of ' +document.forms[0].name + ' = '+v);
}
else if (form1.elements[4].name=="Button2")
{
alert('Second form name : '+document.forms[1].name);
alert('No. of Form elements of ' +document.forms[1].name + ' = '+v);
}
for(i=0;i<v;i++)
alert(form1.elements[i].name+ ' is at position '+i);
}
</SCRIPT>
</HEAD>
<BODY>
<FORM Name="Survey Form 1">
FIRST FORM: <i><b>Survey Form 1 </b></i><BR><BR>
First Name : <Input Type=Text Name="Text1" Value=""><BR><BR>
<Input Type="radio" Name="Radio1" Value=""> Fresher
<Input Type="radio" Name="Radio1" Value=""> Experienced<BR><BR>
<Input Type="Button" Name="Button1" Value="Click1" onClick="Ver(form)">
</FORM>
<FORM Name="Survey Form 2">
SECOND FORM: <i><b> Survey Form 2 </b></i><BR><BR> Name : <Input Type="Text" Name="Text2" Value=""> <BR><BR>
Password : <Input Type="Password" Name="Pass2" Value="">
<BR><BR>
<BR><BR>
<Input Type="CheckBox" Name="Check1" Value="" > Employed
<Input Type="CheckBox" Name="Check2" Value="" > Studying
<Input Type="Button" Name="Button2" Value="Click2"
onClick="Ver(form)">
</FORM>
</BODY>
</HTML>