Reply to Re: How to submit a form when user presses Enter key

Your name:

Reply:


Posted by radmission05@gmail.com on 10/07/08 12:00

On Jan 15, 11:04 am, Daniel Klein <dani...@featherbrain.net> wrote:
> I'm pretty new at php and web stuff so please be gentle with me.
>
> I'm trying to get a form to submit when the user presses the Enter
> key. I do not want to use javascript. I've googled this to death and
> cant find the answer (only hints), except on the 'Experts Exhange'
> page and you have to pay to get the answer :-(
>
> Why is this such a secret in the open source world we live in?
>
> Daniel Klein

check this

<script type="text/javascript">
function submit_form(frm)
{
if(event.key==13)
{
document.getElementById(frm).submit();
}
}

</script>


<form name="myform" id="myform" action="">
<input type="text" name="username" onkeydown="submit_form('myform')">
<input type="password" name="password"
onkeydown="submit_form('myform')">
<input type="submit" name="Submit" value="Submit">
</form>

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация