Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Jun 2007
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Problem with submit form

    Hello

    I want to submit a username and a password without a mouseclick.

    i have read various topics about this and get alot of tips regarding the onload function. But somehow this doesnt seem to work.

    I want to use this function in a web-based application, so its a mixed code.


    this is the code (and its gotta be preserved because this is the working code)

    <HTML><HEAD>
    <SCRIPT event=onload for=window>
    </SCRIPT>

    <META charset=utf-8 http-equiv=Content-Type content=text/html>
    <META content="MSHTML 6.00.2900.3086" name=GENERATOR>
    <SCRIPT src="/newsway/versions/250/site/iway/inc/callback.js"></SCRIPT>
    <LINK rel=stylesheet></HEAD><META http-equiv="pragma" CONTENT="NO-CACHE"><META http-equiv="expires" CONTENT="0"><META http-equiv="content-type" CONTENT="text/html; charset=utf-8">
    <BODY onmousedown="return checkNotInEditorMode()">
    <FORM name=form1 onsubmit="return false" action="" method=post><LABEL><INPUT onkeypress=submitIfEnter() id=iwayUsername name=textfield value="pod" activateName activated="true" activateListKey="loginUsername" activateType="loginUsername"> <INPUT onkeypress=submitIfEnter() id=iwayPassword type=password name=textfield2 value="pod" activateName activated activateListKey="loginPassword" activateType="loginPassword"> </LABEL><LABEL></LABEL><LABEL><INPUT id="submit" onclick=submitLogin() type=submit value=GOOO name=Submit activateName activated="true" activateListKey="loginButton" activateType="loginButton"> </LABEL></FORM>
    <SCRIPT src="/newsway/versions/250/site/iway/app/skinEditor/functions.js"></SCRIPT>

    <SCRIPT src="/newsway/versions/250/site/iway/inc/clientDB.js"></SCRIPT>


    <FORM id='linkForm' name='linkForm'></FORM><IFRAME id='hiddenFrame' name='hiddenFrame' frameborder='0' style='WIDTH:0px;HEIGHT:0px;' src="/newsway/versions/250/site/iway/Empty.htm"></IFRAME><FORM id='loginForm' name='loginForm' method=post><INPUT id='loginPage' name='loginPage' style='DISPLAY:none;WIDTH:0px;HEIGHT:0px;' type=hidden value=custom><INPUT id='localizationsection' name='localizationsection' style='DISPLAY:none;WIDTH:0px;HEIGHT:0px;' type=hidden><INPUT id='firsturlselection' name='firsturlselection' style='DISPLAY:none;WIDTH:0px;HEIGHT:0px;' type=hidden><INPUT id='username' name='username' style='DISPLAY:none;WIDTH:0px;HEIGHT:0px;' type=hidden><INPUT id='password' name='password' style='DISPLAY:none;WIDTH:0px;HEIGHT:0px;' type=hidden></FORM><IFRAME id='loginFrame' name='loginFrame' frameborder='0' style='WIDTH:0px;HEIGHT:0px;' src="/newsway/versions/250/site/iway/Empty.htm"></IFRAME></BODY></HTML>


    i picked a quick username/password as pod pod and a GOOO submit button.

    now what i would like to see is that on load of the webpage, the data is submitted automaticly


    can anyone help me?

    thanks

  • #2
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,043
    Thanks
    0
    Thanked 251 Times in 247 Posts
    You have to change this:
    Code:
    <SCRIPT event=onload for=window>
    </SCRIPT>
    to:
    Code:
    <script type="text/javascript">
    window.onload = function(){
      document.form1.submit();
    }
    </script>


  •  

    Posting Permissions

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