HTML & Ajax not working as expected
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: HTML & Ajax not working as expected

Hybrid View

  1. #1
    Join Date
    Oct 2008
    Posts
    17

    HTML & Ajax not working as expected

    Please tell me why the following html does not call the javascript submit_click() function.
    Code:
    <!DOCTYPE html>
    <html>
        <head>
        <title>Page Title</title>
        <meta name="viewport" content="width=device-width,initial-scale=1">
        <link rel="stylesheet" type="text/css" href="style/style.css"/>
        <script language="JavaScript" type="text/javascript" src="js/Diva.js"></script>
        <style type="text/css">a {text-decoration: none}</style>
        <script language=javascript>
        function submit_click()
            {
            alert("Button Pressed");
            progExe("logon.php?"uname="+uname+"&Passwrd="+passwrd);
            }
        </script>
        </head>
    
        <body>
    <!--- <form name="logon" ID="logon" action="logon.php" method="post"> -->
    <table align="center" border="3" cellspacing="0" cellpadding="3">
    <tr><td>Username:</td><td>
    <input type="text" name="uname" id=uname maxlength="40" placeholder="Enter your UserName" autofocus required>
    </td></tr>
    <tr><td>Password:</td>
    <td>
    <input type="password" name="passwrd" id=passwrd maxlength="50" placeholder="Password" required>
    </td></tr>
    <tr><td colspan="3" align="center">
    <button type="button" onclick="submit_click()">Logon</button>
    <a href="register.html"><input type=submit value="RegisterSelf">
    <a href="client.html"><input type=submit value="RegisterClient">
    </td></tr>
    </table>
    <center>
    <div id="loadingNode";></div>
    </center>
    </body>
    </html>

  2. #2
    Join Date
    Jun 2009
    Posts
    86

    Re: HTML & Ajax not working as expected

    You have a bug in the line:
    Code:
    progExe("logon.php?"uname="+uname+"&Passwrd="+passwrd);
    It should probably be something like:
    Code:
    progExe("logon.php?uname="+uname+"&Passwrd="+passwrd);

Posting Permissions

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


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center