The code is as given below. WHen I submit this form I get a error alert " 'document.form2' is null or not an object". I am confused of why this the error. Any suggestions welcome. Thanks for your time.
<script>
function sub2()
{
try
{
document.form2.submit();
}
catch(err)
{
al = err.description;
alert(al);
}
}
</script>
<form name="form2" action="browseservlet" >
<select name="category" onchange="sub2()">
<option value="">category</option>
<% for(int i = 0; i<category.length; i++)
{ %>
<option value="<%= urlct %>" ><%= category %>, <%= countct %> nos</option>
<% } %>
</select>
</form>
regards
<script>
function sub2()
{
try
{
document.form2.submit();
}
catch(err)
{
al = err.description;
alert(al);
}
}
</script>
<form name="form2" action="browseservlet" >
<select name="category" onchange="sub2()">
<option value="">category</option>
<% for(int i = 0; i<category.length; i++)
{ %>
<option value="<%= urlct %>" ><%= category %>, <%= countct %> nos</option>
<% } %>
</select>
</form>
regards