hi all,
my problem:
i have a form that is sent through ajax with ajax.updater.
the onsubmit function looks like this:
new Ajax.Updater(
    { failure:''command_div'' },
    ''/windows/chat_post'', 
    {
      asynchronous:true,
     parameters:Form.serialize(this
    }
  ); 
 return false;
this works fine when I submit the form by pressing the submit button.
But when I submit the form with a javascript theform.submit() command, the
onsubmit function does not get evaluated and the browser simply loads the form
action url.
So: How can I setup my form so that on the submit() command the browser calls my
onsubmit function and not load the form action?
Calling the onsubmit function directly would be an answer, but I want to keep
the submit part generic.
______________________________________________________________
Verschicken Sie romantische, coole und witzige Bilder per SMS!
Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193
I just always call the onsubmit directly. What are your reasons for wanting to "keep the submit part generic"? -John> hi all, > my problem: > > i have a form that is sent through ajax with ajax.updater. > the onsubmit function looks like this: > > new Ajax.Updater( > { failure:''command_div'' }, > ''/windows/chat_post'', > { > asynchronous:true, > parameters:Form.serialize(this > } > ); > return false; > > > this works fine when I submit the form by pressing the submit button. > > But when I submit the form with a javascript theform.submit() > command, the onsubmit function does not get evaluated and the > browser simply loads the form action url. > > So: How can I setup my form so that on the submit() command the > browser calls my onsubmit function and not load the form action? > > Calling the onsubmit function directly would be an answer, but I > want to keep the submit part generic.