uknowho008 Posted September 1, 2007 Share Posted September 1, 2007 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 More sharing options...
uknowho008 Posted September 1, 2007 Author Share Posted September 1, 2007 it looks like xhtml doesnt validate with "name" for the form. so i might need a whole new way of doing this. so does can anybody help me find a way to do this that still validates xhtml? thanks. Link to comment https://forums.phpfreaks.com/topic/67539-javascript-with-css-ids/#findComment-339148 Share on other sites More sharing options...
uknowho008 Posted September 1, 2007 Author Share Posted September 1, 2007 ok i figured out how to make it comply with xhtml standards. but i still would like to know how to run this function with the id if possible. thanks. Link to comment https://forums.phpfreaks.com/topic/67539-javascript-with-css-ids/#findComment-339156 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.