Jump to content

ajax jquery issue


gotornot

Recommended Posts

Hi i wonder if you can help.

I am trying to use a ajax call to collect data from a php file i managed to get this to work but how do i get the value of "Response" to output in html on the page after a form is submitted?

$('form.ticketform').on('submit', function(){
    
    var that = $(this),
        url = that.attr('action'),
        type = that.attr('method'),
        data = {};
        
    that.find('[name]').each(function(index, value) {
        var that = $(this),
            name = that.attr('name'),
            value = that.val();
            
        data[name] = value;
    });
    
        $.ajax({
        url: url,
        type: type,
        data: data,
        success: function(response){
            return response;
        }
    });

    

    return false;
});
 

Link to comment
https://forums.phpfreaks.com/topic/286245-ajax-jquery-issue/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.