You are here: Re: How does one stop the enter-key from working? « HTML « IT news, forums, messages
Re: How does one stop the enter-key from working?

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.

 

Navigation:

[Reply to this 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

Π‘Π°ΠΉΡ‚ ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ Π² Π‘Ρ‚ΡƒΠ΄ΠΈΠΈ Π’Π°Π»Π΅Π½Ρ‚ΠΈΠ½Π° ΠŸΠ΅Ρ‚Ρ€ΡƒΡ‡Π΅ΠΊΠ°
ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ΠΈΠ΅ ΠΈ ΠΏΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΊΠ° Π²Π΅Π±-сайтов, Ρ€Π°Π·Ρ€Π°Π±ΠΎΡ‚ΠΊΠ° ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΠ½ΠΎΠ³ΠΎ обСспСчСния, поисковая оптимизация