PDA

Click to See Complete Forum and Search --> : submitting a form with <A>


bmarzouk
Mar 11th, 2002, 05:02 AM
Hello,

The following code doesn't work with Netscape 6.2, while it works with IE, what is the problem

<FORM method="post" name="Form1">
<INPUT type="hidden" name="ReportType">
<A name="0">
<A href="#0" onClick='javascript:Form1.item("ReportType").value=1;Form1.action="Report_Details.asp";Form1.submit()'>Report1</A> <BR><BR>
<A href="#0" onClick='javascript:Form1.item("ReportType").value=2;Form1.action="Report_Details.asp";Form1.submit()'>Report2</A> <BR><BR>
</FORM>

veryjonny
Mar 11th, 2002, 05:48 AM
<script language="javascript">
function SubMitForm(theForm,intvalue)
{
document.theForm.ReportType.value = intValue;
document.theForm.submit();
}
</script>

and in the form part do this:

<form name="form1" action="Report_Details.asp" >
<INPUT type="hidden" name="ReportType">

<A href="Javascript:SubMitForm(document.form1,1);">Report1</A> <BR><BR>
<A href="Javascript:SubMitForm(document.form1,2);">Report2</A> <BR><BR>
</FORM>



Hope this hleps...:)