Results 1 to 2 of 2

Thread: Submitting my login form on enter

  1. #1
    Join Date
    Oct 2010

    Submitting my login form on enter

    For some reason when I hit enter on my javascript form nothing happens, I must click the logon button for it to work. Here is the function that builds the logon form
    function BuildPanel() {
    document.write('<form name="logon"><table align="center" border="0"><tr><td align="right">');
    document.write('<small><font face="Verdana">Username:</font></small></td>');
    document.write('<td><small><font face="Verdana"><input type="text" name="username" size="20"></font></small></td></tr>');
    document.write('<tr><td align="right"><small><font face="Verdana">Password:</font></small></td>');
    document.write('<td><small><font face="Verdana"><input type="password" name="password" size="20"></font></small></td></tr>');
    if(imgSubmit == ""){
     document.write('<tr><td align="center" colspan="2"><p><input type="button" value="Logon" name="Logon" onclick="login(username.value,password.value)">'); 
    } else {
     document.write('<tr><td align="center" colspan="2"><p><input type="image" src="'+imgSubmit+'" name="Logon" onclick="login(username.value,password.value)">');
    if(imgReset == ""){
     document.write('<input type="reset" value="Reset" name="Reset">');
    } else {
     document.write('<input type="image" src="'+imgReset+'" name="Reset" onclick="logon.reset();">');
    Is it possible to make this work when the user hits the enter button?
    thank you
    Share on Google+

  2. #2
    Join Date
    Oct 2010
    I just realized I put this in the wrong forum, sorry guys ill repost in the correct forum
    Share on Google+

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