[jQuery] Re: Avoid enter keypress to submit form

2007-09-28 Thread traunic
I have used this before: $("form:first").submit(function(){return false;}); $("#myButton").click(function(){$("form:first").get(0).submit();}); Basically prevents the form from submitting unless I explicitly instruct it to in JS. On Sep 25, 7:05 am, "Fabien Meghazi" <[EMAIL PROTECTED]> wrote: >

[jQuery] Re: Avoid enter keypress to submit form

2007-09-28 Thread Peter Tung
On Sep 26, 10:10 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > > 1. remove the type=submit button. you need to also use javascript to > > submit form. > > Really? > > Try this: > > > > > 'Enter' works for me in FF (I didnt check on other browsers) > > Michael Yes, you are right. I mad

[jQuery] Re: Avoid enter keypress to submit form

2007-09-26 Thread [EMAIL PROTECTED]
> 1. remove the type=submit button. you need to also use javascript to > submit form. Really? Try this: 'Enter' works for me in FF (I didnt check on other browsers) Michael

[jQuery] Re: Avoid enter keypress to submit form

2007-09-25 Thread [EMAIL PROTECTED]
> Is there an non javascript way to avoid "enter" keystroke in an input > to trigger the form submit or am I forced to catch keystroke code 13 > in javascript ? > > If force to do in javascript, is there a way to catch keystroke event > of only one input and not window object ? Is there already a

[jQuery] Re: Avoid enter keypress to submit form

2007-09-25 Thread Peter Tung
2ways. 1. remove the type=submit button. you need to also use javascript to submit form. 2. add key down, key up etc. on any elements you want to avoid enter, not only window. On 9月25日, 下午1时05分, "Fabien Meghazi" <[EMAIL PROTECTED]> wrote: > Hi, > > Is there an non javascript way to avoid "enter

[jQuery] Re: Avoid enter keypress to submit form

2007-09-25 Thread Peter Tung
Yes, I think you can do it in many ways... 1. remove button. Then the enter will not invoke form's submit. But you should add form submit function in somewhere. 2. You can catch the 13 keycode in any element's key event, not only window object. On 9月25日, 下午1时05分, "Fabien Meghazi" <[EMAIL PROTE