Posting data from a form using this function:

$(function() {
    $('#emailform').submit(function() {
        $.ajax({
            url: '/post/url/',
            dataType: 'json',
            data: $('#emailform').serialize(),
            success: function(rdata) {
                $('#emailformmessage').text(rdata.message).show
('slow');
            }
        });
    });
    return false;
});

the server doesn't detect an ajax call ('X-Requested-With' header is
not sent). I tried forcing it with beforeSubmit and also with
ajaxSetup,  but no go.
Any solutions to this problem?

hadaraz

Reply via email to