Hi, You should be observing the form's submit event not the submit button's click event.
Best, Tobie On Dec 29, 8:19 am, Turner <[EMAIL PROTECTED]> wrote: > I've just started using Prototype, and it's mostly been pretty good to > me. I just have one strange problem. I'm observing a click event on a > comment submit button in order to run a function before it submits a > form. That function, among other things like validation, submits an > AJAX request to add to the database. The idea is that it should do the > AJAX request if the browser supports it and then stop the event from > submitting the form (if there is no AJAX support, it should go ahead > and submit it). > > So I'm using Prototype's Ajax functions, and I have an onSuccess > function that does its stuff with the server response and then stops > the event using event.stop(). Well, I'm having mixed results--the AJAX > goes through fine, but the form is still being submitted, in addition > to the AJAX request. The event claims to be stopped (that is, > event.stopped is true after I call event.stop(), as it should be), so > it doesn't seem like a bug there (besides, I tried calling > event.preventDefault() just in case, and got the same results). Not > that I thought it would be, but you know, try everything, right? > > Anyway, this is pissing me off and after hours of debugging I have > gotten no results. Of course, this probably means that it's some > ridiculously trivial fencepost error or something of that nature, but > I thought maybe someone here would have some idea of what could be > going wrong. > > Oh, and I get this behavior on IE7 (Windows Vista) and Firefox > 2.0.0.11 (Vista and Ubuntu). Haven't tested other browsers. --~--~---------~--~----~------------~-------~--~----~ 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 [email protected] 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 -~----------~----~----~----~------~----~------~--~---
