Welcome visitor
* Login
* Register
It is currently September 16th, 2019, 12:15 pm
All times are UTC [ DST ]
* Search
View unanswered posts - View active topics

FORUMS » Client Side » HTML



Post new topic Reply to topic  [ 4 posts ] 
Author Message
  how to submit a form by pressing the enter key
PostPosted: October 13th, 2009, 12:11 am 

Posts: 48
this simple form doesnt submit on enter, why?!
<form action="http://www.google.com">
<input />
<input />
</form>


Top
 Profile  
 
  Re: how to submit a form by pressing the enter key
PostPosted: October 13th, 2009, 1:30 am 
User avatar

Posts: 21
The ENTER key works based on the SEND button.

In other word, you need to include the following code:

 <input type="submit" /> 



GREETS!!

_________________
IT. Consulting
www.tnogos.com


Top
 Profile  
 
  Re: how to submit a form by pressing the enter key
PostPosted: October 13th, 2009, 2:50 am 
User avatar

Posts: 112
Or you can add it with a javascript.
<script type="text/javascript">
document.onkeypress = validateEnter;
document.onkeydown = validateEnter;
function validateEnter(e){
if (e.keyCode == 13){document.forms[0].submit();}}
</script>

http://www.scriptingok.com/forum/t12_716-Block-submit-onenter


Top
 Profile  
 
  Re: how to submit a form by pressing the enter key
PostPosted: October 13th, 2009, 3:55 pm 

Posts: 48
Thank you!I think im going to do that :D


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

FORUMS » Client Side » HTML


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron