onload to submit

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • tony wong

    onload to submit

    i wish the html to submit the form once it is loaded.

    what should be the code here (alert("how 's the code here"))?

    Grateful if you could help me. Thanks a lot.

    Tony
    *************** *************** *************** ****
    <html>
    <head>
    <script language="JavaS cript" type="text/javascript">
    function window_onload()
    {
    alert("how 's the code here")
    }
    </script>
    </head>
    <body bgcolor=green onload=window_o nload()>
    <FORM NAME="Form1"ACT ION="page2.asp" METHOD="POST" target=mainFram e>
    <SELECT NAME="YEARLIST" >
    <OPTION>01</OPTION>
    <OPTION>02</OPTION>
    </SELECT>
    <INPUT TYPE="SUBMIT" VALUE="Submit">
    <INPUT TYPE="RESET" VALUE="Reset">
    </body>
    </html>


  • McKirahan

    #2
    Re: onload to submit

    "tony wong" <x34@netvigator .com> wrote in message
    news:42f721fe$1 @127.0.0.1...[color=blue]
    > i wish the html to submit the form once it is loaded.
    >
    > what should be the code here (alert("how 's the code here"))?
    >
    > Grateful if you could help me. Thanks a lot.
    >
    > Tony
    > *************** *************** *************** ****
    > <html>
    > <head>
    > <script language="JavaS cript" type="text/javascript">
    > function window_onload()
    > {
    > alert("how 's the code here")
    > }
    > </script>
    > </head>
    > <body bgcolor=green onload=window_o nload()>
    > <FORM NAME="Form1"ACT ION="page2.asp" METHOD="POST" target=mainFram e>
    > <SELECT NAME="YEARLIST" >
    > <OPTION>01</OPTION>
    > <OPTION>02</OPTION>
    > </SELECT>
    > <INPUT TYPE="SUBMIT" VALUE="Submit">
    > <INPUT TYPE="RESET" VALUE="Reset">
    > </body>
    > </html>
    >[/color]

    If you want the form to be submitted once the page loads
    why bother to include any buttons; also,
    why submit the form before an option can be selected?

    But if what you say you want is what you really want
    then just change your <body> tag to
    <body onload="documen t.Form1.submit( )">
    and remove the <script> section.


    P.S. You clock may be off.


    Comment

    • Mavrick

      #3
      Re: onload to submit

      <formname>.subm it()
      ie form1.submit()

      or document.form1. submit

      if you have a parameter on the function forma cal also be passed

      Comment

      Working...