[jQuery] Re: submitting a form by pressing enter

2008-06-27 Thread tlob
Hy Steen I totally agree with you. And I did not know the CSS display:none will break the submit. Good to know! THX. cheers tl On Jun 27, 11:35 am, Steen Nielsen <[EMAIL PROTECTED]> wrote: > A lot of browsers support usage without JS and CSS. Especially mobile > devices or screenreaders have v

[jQuery] Re: submitting a form by pressing enter

2008-06-27 Thread Steen Nielsen
Well, you could do this in two ways, one is to actually make it into a form and the do something when the submit have been activated. The other way includes what you probably are looking for. You want to read the key that have been pressed. For this you need to register the keycode on the key dow

[jQuery] Re: submitting a form by pressing enter

2008-06-27 Thread Steen Nielsen
A lot of browsers support usage without JS and CSS. Especially mobile devices or screenreaders have very bad JavaScript support, and screenreaders "read" the content of the page as it's shown without CSS. Even though we can argue for a long time whether or not it's a good idea to only support cli

[jQuery] Re: submitting a form by pressing enter

2008-06-26 Thread Dean Landolt
It's been my experience that listening for keycodes in js can be a bit hairy. If you have a bunch of inputs, it's probably semantic to wrap them in a form (the div too if you like), then you could take advantage of the on built-in event listener but just prevent the actual form submission: $('#myF

[jQuery] Re: submitting a form by pressing enter

2008-06-26 Thread [EMAIL PROTECTED]
Thanks for your replies. I have a follow up question. Let's say I have a bunch of inputs, type="text" within a div with id="myDiv". How do trigger an action if someone presses enter within one of those text fields? This would not be a form submission necessarily. - Dave On Jun 26, 5:25 am,

[jQuery] Re: submitting a form by pressing enter

2008-06-26 Thread tlob
A page is read without css? Hmmm I think that is really really really rare Even more rare than a browser without js turned on. Thats only really really rare ;-) Or what do you mean? instead of moving it away, why not css display:none;? Does this brake the submit? cheers tl On Jun 26, 10:22

[jQuery] Re: submitting a form by pressing enter

2008-06-26 Thread Steen Nielsen
You need to insert a submit button in the form to get it working.. if you don't want to show the button you can always hide it using CSS. I usually just positioning it -9000px to the left, that way it won't show up, but if the page is read without CSS, it will be shown correctly with a submit bu

[jQuery] Re: submitting a form by pressing enter

2008-06-26 Thread andrea varnier
On 26 Giu, 06:20, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Hi, > > I have a form, with id="myForm", with a number of text fields (input > with type="text").  How do I cause a form submission by pressing enter > in any of those form fields? hi. shouldn't this be a default?