|
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]
|