www.webdeveloper.com
Results 1 to 7 of 7

Thread: Auto submit credentials

Hybrid View

  1. #1
    Join Date
    Jan 2011
    Posts
    1

    Question Auto submit credentials

    I have managed to figure out how to pass credentials but I am really struggling with how to have the submit button invoke automatically. My dream is for the below code which is tied to a URL to pass the credentials to the webpage and enter with just the user clicking the URL link.

    Is it possible?

    Here is my code:

    How can I get the submit to auto run?

    My code is as follows:

    <html>
    <head>
    <style>
    div {padding-bottom: 10px;}
    </style>
    </head>
    <body>
    <form action="URL Link Here" method="post">
    <input type="hidden" name="username" value="USER" />
    <input type="hidden" name="password" value="GUEST"/>
    <div><input type="submit" value="Guest Login" /></div>
    </form>
    </body>
    </html>

  2. #2
    Join Date
    Apr 2012
    Location
    Lahore
    Posts
    1

    Auto Submit FORM

    I know its very late to reply this question, but adding the answer so might help any one else.

    Let say we want to submit the form as soon as the page get loaded.
    I have marked my changes as bold in your code.

    <html>
    <head>
    <style>
    div {padding-bottom: 10px;}
    </style>
    </head>
    <body>
    <form name="frm1" action="URL Link Here" method="post">
    <input type="hidden" name="username" value="USER" />
    <input type="hidden" name="password" value="GUEST"/>
    <div><input type="submit" value="Guest Login" /></div>
    </form>
    </body>
    <script languge="javascript">
    document.frm1.submit();
    </script>
    </html>

    NOTE: Please remember the above code might immediately submit the form (and navigate away to the provided url) and you may not see this form at all

  3. #3
    Join Date
    Jan 2013
    Location
    Cirebon, West Java
    Posts
    1
    The information interesting and very useful.
    Thank you for your sharing.

  4. #4
    Join Date
    Oct 2013
    Posts
    10
    Quote Originally Posted by mazhar View Post
    I know its very late to reply this question, but adding the answer so might help any one else.

    Let say we want to submit the form as soon as the page get loaded.
    I have marked my changes as bold in your code.

    <html>
    <head>
    <style>
    div {padding-bottom: 10px;}
    </style>
    </head>
    <body>
    <form name="frm1" action="URL Link Here" method="post">
    <input type="hidden" name="username" value="USER" />
    <input type="hidden" name="password" value="GUEST"/>
    <div><input type="submit" value="Guest Login" /></div>
    </form>
    </body>
    <script languge="javascript">
    document.frm1.submit();
    </script>
    </html>

    NOTE: Please remember the above code might immediately submit the form (and navigate away to the provided url) and you may not see this form at all
    I prefer to do this, because it allows me to insert the "onclick" event to input type.
    <script>
    function sendForm() {
    document.frm1.submit();
    }
    </script>

    and in the input type, do this:
    <div><input type="submit" value="Guest Login" onclick="sendForm()" /></div>

  5. #5
    Join Date
    Oct 2013
    Posts
    7
    Quote Originally Posted by rolory View Post
    I prefer to do this, because it allows me to insert the "onclick" event to input type.
    <script>
    function sendForm() {
    document.frm1.submit();
    }
    </script>

    and in the input type, do this:
    <div><input type="submit" value="Guest Login" onclick="sendForm()" /></div>
    Hi rolory, do you know if the same thing can be done in my case?

    Here is the form url:

    https://www.iauc.co.jp/auction/prelogin01_en.jsp

  6. #6
    Join Date
    Jan 2013
    Posts
    23

    Best virtual server

    hi
    this auto submitter script is well code. or also available on internet in more easy way once search on that..

  7. #7
    Join Date
    Oct 2013
    Posts
    7
    Can anyone please help me out with this login form? I want to do exactly the same thing steve204 has asked about but I am having difficulty. Instead of posting what I had I'm just posting the original code.
    Any help greatly appreciated.
    I can give you the username and pass also to check if it is working.


    <form name="form1" method="post" action="/auction/servlet/authenticate" target="_self">
    <!-- ■ INPUT ■ -->
    <input name="mode" type="hidden" id="mode" value="login">

    <table class="login-form" align="center">
    <tr class="spacer">
    <td colspan="2"><img src="/pv/img/shim.gif"></td>
    </tr>
    <tr>
    <td align="right"><b><font color="#FFFFFF" class="font">ID : </font></b></td>
    <td class="input">
    <!-- ■ INPUT ■ -->
    <input type="text" name="member_cd" size="25" maxlength="9" value="">
    </td>
    </tr>
    <tr>
    <td align="right"><b><font color="#FFFFFF" class="font">Password : </font></b></td>
    <td class="input">
    <!-- ■ INPUT ■ -->
    <input type="password" name="pwd" size="35" maxlength="18" value="">
    </td>
    </tr>
    <tr class="spacer">
    <td colspan="2"><img src="/pv/img/shim.gif"></td>
    </tr>
    <tr>
    <td colspan="2" align="center">
    <!-- ■ INPUT ■ -->
    <input class="button" type="submit" value="Login">
    <input class="button" type="reset" value="Cancel">
    </td>
    </tr>
    <tr class="spacer">
    <td colspan="2"><img src="/pv/img/shim.gif"></td>
    </tr>
    <tr>
    <td style="border-style: hidden; text-align: right;">
    <!-- ■ INPUT ■ -->
    <input type="checkbox" name="prelogin_chk" id="prelogin_chk" value="on" checked>
    <input type="hidden" name="step" value="1">
    <input type="hidden" name="fnc" value="login">
    </td>
    <td><label for="prelogin_chk"><b><font color="#FFFFFF" class="font">
    Remember ID/Password<br>
    on this computer.</font></b></label>
    </td>
    </tr>
    </table>
    </form>
    <div style="height: 36px;"><img src="/pv/img/shim.gif" height="1"></div>
    <div style="color: #FF0000">Member's Only</div>
    <div style="height: 36px;"><img src="/pv/img/shim.gif" height="1"></div>
    </div>
    </div>

    </body>
    </html>

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles