Post the form automatically

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • smartic
    New Member
    • May 2007
    • 150

    Post the form automatically

    i'm having form that have default values on it i need to post the form automatically how can i do that?
  • ak1dnar
    Recognized Expert Top Contributor
    • Jan 2007
    • 1584

    #2
    Originally posted by smartic
    i'm having form that have default values on it i need to post the form automatically how can i do that?
    When the page is loading you can submit your form with onload() event with.
    By Adding this

    Code:
    <body onload="document.form_name.submit();">

    Comment

    • smartic
      New Member
      • May 2007
      • 150

      #3
      I tried your code but it didn't work with me and give me an error (Object dosn't support this property or method)

      Comment

      • ak1dnar
        Recognized Expert Top Contributor
        • Jan 2007
        • 1584

        #4
        Originally posted by smartic
        I tried your code but it didn't work with me and give me an error (Object dosn't support this property or method)
        Its a error with Java Script, Why dont you post the Code Here.

        Comment

        • smartic
          New Member
          • May 2007
          • 150

          #5
          Code:
          <body onLoad="document.panel.submit();">
          <form action="any link" method="post" name="panel" id="panel">
          Username
          <input class="inputbox" type="text" name="uname" maxlength="40" value="user value">
          Password
          <input class="inputbox" type="password" name="passwd" maxlength="50" value="pass value">
          <input class="inputbox" type="submit" name="submit" value="Login">
          </form>
          </body>

          Comment

          • ak1dnar
            Recognized Expert Top Contributor
            • Jan 2007
            • 1584

            #6
            Please remove the submit button from the Form. It will work.
            Thanks !

            Comment

            Working...