#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2013
    Posts
    2
    Rep Power
    0

    Question [How to] Make auto submit a form in HTML page


    Hi,
    This is my first time here and i tried the search bar with hardly no good.
    I'm facing difficulty with my local network login page making a username/password&submit button to auto-submit once page is loaded without any interference from my side.
    *username/password fields are automatically filled with save info in browser"

    Here is the login page source code as it may give a hint how to advise me:
    Thank you in advance
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "w3.org..."> <html> <head> <title>internet hotspot > login</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <meta http-equiv="pragma" content="no-cache" /> <meta http-equiv="expires" content="-1" /> <style type="text/css"> body {color: #737373; font-size: 10px; font-family: verdana;} textarea, input, select { background-color: #FDFBFB; border: 1px solid #BBBBBB; padding: 2px; margin: 1px; font-size: 14px; color: #808080; } a, a:link, a:visited, a:active { color: #AAAAAA; text-decoration: none; font-size: 10px; } a:hover { border-bottom: 1px dotted #c1c1c1; color: #AAAAAA; } img {border: none;} td { font-size: 14px; color: #7A7A7A; } </style> </head> <body bgcolor="#000000"> <form name="sendin" action="server IP here/login" method="post"> <input type="hidden" name="username" /> <input type="hidden" name="password" /> <input type="hidden" name="dst" value="" /> <input type="hidden" name="popup" value="true" /> </form> <script type="text/javascript" src="/md5.js"></script> <script type="text/javascript"> <!-- function doLogin() { document.sendin.username.value = document.login.username.value; document.sendin.password.value = hexMD5('\036' + document.login.password.value + '\314\056\011\162\231\303\221\245\301\132\375\334\244\256\177\376'); document.sendin.submit(); return false; } //--> </script> <table width="100%" style="margin-top: 10%;"> <tr> <td align="center" valign="middle"> <div class="notice" style="color: #c1c1c1; font-size: 9px">&nbsp;</div><br /> <table width="280" height="100" style="border: 1px solid #cccccc; padding: 0px;" cellpadding="0" cellspacing="0"> <tr> <td align="center" valign="bottom" height="256" colspan="2"> <form name="login" action="server IP here/login" method="post" onSubmit="return doLogin()" > <input type="hidden" name="dst" value="" /> <input type="hidden" name="popup" value="true" /> <table width="100" style="background-color: #ffffff"> <tr><td align="right">login</td> <td> <input style="width: 80px" name="username" type="text" value="" size="20"/></td> </tr> <tr><td align="right">password</td> <td> <input style="width: 80px" name="password" type="password" size="20"/></td> </tr> <tr><td>&nbsp;</td> <td><input type="submit" value="OK" /></td> </tr> </table> </form> </td> </tr> <tr><td align="center" height="1"></td></tr> </table> <br /> <p> </td> </tr> </table> <script type="text/javascript"> <!-- document.login.username.focus(); //--> </script> </body> </html>
  2. #2
  3. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2011
    Location
    The Pleiades
    Posts
    299
    Rep Power
    8
    Good morning DaHiA,

    You could run a function when the page has loaded and use the submit() function in JavaScript.

    Why do you want the form to auto submit?

    Will the form contain any post/get data?

    Regards,

    NM.
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2013
    Location
    Lucknow
    Posts
    3
    Rep Power
    0

    Thumbs up


    First of all design your form and add no of fields you require as user name and pass.
    <div>
    <form>
    <input style="width: 80px" name="username" type="text" value="" size="20"/>
    <input style="width: 80px" name="password" type="password" value="" size="20"/>
    <input style="width: 80px" name="submit" type="submit" value="" size="20"/>
    </form>
    </div>
    Ravi Tripathi
    Net World Point IT Solutions Pvt Ltd
  6. #4
  7. No Profile Picture
    Banned
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2013
    Location
    New Delhi
    Posts
    1
    Rep Power
    0

    Html5


    You'll have to call the submit() method of the form on the ... This also enables you to add the functionality to a basic link, as you have requested.
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2013
    Posts
    2
    Rep Power
    0
    I have the form ready but i wonder what should i add in order to make the form auto submit?
    Kindly advise as i have hardly no experience.

IMN logo majestic logo threadwatch logo seochat tools logo