Reply to Re: How does one stop the enter-key from working?

Your name:

Reply:


Posted by Mr.G (@�@) on 05/28/07 19:53

On Apr 27, 2:00 am, "scripts.contact" <scripts.cont...@gmail.com>
wrote:
> On Apr 26, 8:03 am, "Mr.G (@¿@)" <goo...@netzero.net> wrote:
>
> > Hi and thanks in advance. I have a form and if the enter-key is
> > pressed the from terminates and they never get to finish it. Is there
> > a way to turn off the enter key? thanks.
>
> you need some js:
>
> function check(ev,form){
> ev=window.event||ev;
> var e=ev.target||ev.srcElement
> if(ev.keyCode==13){
> if(/submit|reset/i.test(e.type)||
> e.tagName.toLowerCase()=="button")return
> for(var i=0,es=form.elements;es[i]!=e&&i<es.length;i++){}
> es[i+1].focus()
> return false
> }
> }
>
> In html:
>
> <form ... onkeypress="return check(event,this)">
> ...
> </form>
>
> Test(ie users, stay away):http://tinyurl.com/27r76r

First of all let me thank all the information and if someone will
write me a "catch" for a form not completely filled out that would be
the best. I guess it would of cource be in PHP and use a if'/else
statment.

[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

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