That's something I hadn't thought of... I do occasionally run into
"element,parentNode is null" errors where an element is trying to be
accessed after it's already gone from the DOM. After that javascript
either stops working or stops working correctly, so maybe that is
causing problems with form submits.
The forms themselves are created automatically via rails methods.
Here's an example:
<form action="/schedule/schedule/admin_changeweek?call=new&;offset=0"
method="post" onsubmit="new Ajax.Updater('ajax-target', '/schedule/
schedule/admin_changeweek?call=new&offset=0', {asynchronous:true,
evalScripts:true, parameters:Form.serialize(this)}); return false;">
<div style="margin: 0pt; padding: 0pt; display: inline;">
<input type="hidden" name="authenticity_token"
value="QU5mck5zVrkVPH9/N1J0oiirSJ5tj5/oKfyx4nZB2as="/></div>
</div>
<!-- lots of form crudd here -->
<input type="submit" name="commit" value="Submit"/>
</form>
My javascript skills are pretty sketchy. Would javascript that got
hung up elsewhere cause problems with processing this form submit?
Thanks for the help.
-Reuben
On Jul 28, 10:50 am, "T.J. Crowder" <[email protected]> wrote:
> Hi,
>
> Never seen anything like that. It would be basically impossible for
> Ajax.Updater to do that. The only thing that comes to mind is if
> you're using submit buttons or similar to trigger the Ajax.Updater
> operation and in some strange situations, you're not cancelling the
> default action of the button. E.g., like this:
>
> HTML:
>
> <form>
> <input type='text' id='txtCriteria'>
> <input type='submit' value='Search' id='btnSearch'>
> </form>
>
> JavaScript:
>
> $('btnSearch').observe('click', function(event) {
> // Some logic here
> doSomething();
> doSomethingElse();
> doAnotherThing();
>
> // We've handled it, stop the event
> event.stop();
> });
>
> In the above, suppose something blows up in `doSomethingElse` because
> of some special weird state the page has gotten itself into. That
> means you're not stopping the event (since the stop is at the bottom,
> but the exception's happened above it), so the form gets submitted --
> reloading the page.
>
> That's the kind of thing I'd be looking for. It's not going to be
> actually _in_ Ajax.Updater if you follow me.
>
> HTH,
> --
> T.J. Crowder
> Independent Software Consultant
> tj / crowder software / comwww.crowdersoftware.com
>
--
You received this message because you are subscribed to the Google Groups
"Prototype & script.aculo.us" 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/prototype-scriptaculous?hl=en.