Results 1 to 2 of 2

Thread: submitting a form with <A>

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Feb 2001
    Location
    Egypt
    Posts
    179

    submitting a form with <A>

    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>

  2. #2
    PowerPoster
    Join Date
    Nov 2001
    Location
    Trying to reach and stay in the cloud
    Posts
    2,089

    hi

    Code:
    <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...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width