This doesn't exactly apply to the question you have, but maybe consider
bringing the "new Form.Request(...)" out of the event function. This way,
each time you click the button, it won't have to recreate the Form.Request
object.
var request = new Form.Request(...);
$('submit').addEvent('click', function (e) {
...
request.send();
});
Happy coding,
~Philip
On Thu, Feb 3, 2011 at 6:08 AM, websam <[email protected]> wrote:
> I'm using the following codesnipet to send a form:
>
> $('submit').addEvent('click', function (e) {
> e.stop();
>
> var errorLabel = $$('.lbl_error');
> var request = new Form.Request(form, errorLabel, {
> resetForm: false,
> extraData: {
> 'content': tinyMCE.activeEditor.getContent()
> },
> onSuccess: function (resp) {
> alert(resp);
> }
> });
> request.send();
> });
>
> However the line alert(resp); returns null even when i see the
> returned text in firebug. What am I doing wrong here?
>
> /Martin