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
https://forums.phpfreaks.com/topic/67539-javascript-with-css-ids/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.