Jump to content

javascript with css id's


uknowho008

Recommended Posts

ive been trying to make a login form that submits by pressing enter so i wont need a login button. well i finally got that figured out, so now i just want to figure out how to do this with the css id method to keep it all clean.

 

it shoudlnt be hard but i cant seem to figure it out, ive tried tons of different things. here is my code the way it works.

 

function IfEnterPost() {

if (event.keyCode == 13) {

  document.LoginForm.submit();

}

}

 

<div class="account">

<form id="LoginForm" name="LoginForm" method="post" action="jerry.html" enctype="text/plain">

  <div>

  <label for="Email">Email</label><input id="Email" type="text" name="Email" />

  <label for="Password">Password</label><input id="Password" type="password" name="Password" onkeypress="IfEnterPost()" />

  </div>

</form>

</div>

 

Thanks guys.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.