Also, make sure that the onsubmit action returns a false so that the actual form action is not called for.
/Anders 14 jun 2008 kl. 04.51 skrev Brian Williams: > move the onclick code back to onsubmit and change the button to > input type=submit > > > On Fri, Jun 13, 2008 at 9:13 PM, Chris <[EMAIL PROTECTED]> > wrote: > > Hi TJ, > Here is a link to simple prototype todo list app > http://chrispurcell.net/blog/demo/todo/ > . > It works fine if you click the "Add" button but when trying to submit > the form with the return key it treats it like a normal form submit. > I did try the onsubmit and had no luck. > Thanks! > --Chris > > On Jun 13, 12:23 am, "T.J. Crowder" <[EMAIL PROTECTED]> wrote: > > Hey Chris, > > > > Can you give us a bit more to go on? Maybe post a minimal test case > > tohttp://pastie.org? Tell us what browsers you're seeing this on and > > what browsers you plan to support? > > > > My first reaction, without knowing the above, is that onclick is a > > mouse event and so it's not a surprise that the keyboard equivalent > > doesn't go through it (it's disappointing, but not _surprising_). > If > > this is a form and the button in question is a submit button, I'd > tend > > to think using the "onsubmit" of the form instead would solve the > > problem (just be sure to return false so it doesn't get submitted > > twice). Otherwise, there are ways to hook keyboard events and do > > this, but it's more hassle. > > > > FWIW. > > -- > > T.J. Crowder > > tj / crowder software / com > > > > On Jun 13, 5:33 am, Chris <[EMAIL PROTECTED]> wrote: > > > > > This may be a really simple problem, my ajax.request only works > if I > > > click the button that has the onclick="Ajax.Updater Function". > > > Whenever I try to submit the form using the return key it > processes it > > > as a non-ajax request. Is there anyway that I can submit my > form by > > > both clicking on the button and hitting the "return" key? > > > Thank you! > > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---