Welcome Guest, Not a member yet? Register   Sign In
Updating my news post (with jquery/Ajax)
#25

[eluser]pickupman[/eluser]
Looks like you may have removed part of the code I had that took care of the dupes. It's the line under the submit handler.
Code:
jQuery(document).ready(function($){
    $("#message").hide();
    $('#busy').hide();
            // $.AJAX Example Request
    $('#news_form').submit(function(eve){
        $('#busy').show('slow');
        $("#message").fadeOut('fast').empty(); //remove message after clicking submit
      
            $.ajax({
                type: "POST",
                data: $(this).serialize(),
                dateType: 'html',
                url: "<?php echo site_url('admin/admin_news/UpdateNews/'.$newspost->news_id);?>",
                success: function(response, status, request){
                    $("#message").append(response).addClass("ui-corner-all ui-state-highlight").fadeIn("slow");
                    $('#busy').hide('slow');
                },
                error: function(){
                    $("#message").html("Update Error!").addClass("ui-corner-all ui-state-error").fadeIn("slow");
                    $('#busy').hide('slow');
                }
                
            });
        eve.preventDefault();

    });

});
EDIT: Added to hide/show your busy div.


Messages In This Thread
Updating my news post (with jquery/Ajax) - by El Forum - 04-11-2010, 08:42 AM
Updating my news post (with jquery/Ajax) - by El Forum - 04-11-2010, 10:46 AM
Updating my news post (with jquery/Ajax) - by El Forum - 04-11-2010, 10:50 AM
Updating my news post (with jquery/Ajax) - by El Forum - 04-11-2010, 11:12 AM
Updating my news post (with jquery/Ajax) - by El Forum - 04-11-2010, 11:16 AM
Updating my news post (with jquery/Ajax) - by El Forum - 04-11-2010, 11:23 AM
Updating my news post (with jquery/Ajax) - by El Forum - 04-11-2010, 11:27 AM
Updating my news post (with jquery/Ajax) - by El Forum - 04-11-2010, 11:43 AM
Updating my news post (with jquery/Ajax) - by El Forum - 04-11-2010, 01:12 PM
Updating my news post (with jquery/Ajax) - by El Forum - 04-11-2010, 03:21 PM
Updating my news post (with jquery/Ajax) - by El Forum - 04-11-2010, 04:03 PM
Updating my news post (with jquery/Ajax) - by El Forum - 04-11-2010, 04:18 PM
Updating my news post (with jquery/Ajax) - by El Forum - 04-11-2010, 06:34 PM
Updating my news post (with jquery/Ajax) - by El Forum - 04-11-2010, 06:54 PM
Updating my news post (with jquery/Ajax) - by El Forum - 04-11-2010, 07:03 PM
Updating my news post (with jquery/Ajax) - by El Forum - 04-11-2010, 07:10 PM
Updating my news post (with jquery/Ajax) - by El Forum - 04-11-2010, 07:43 PM
Updating my news post (with jquery/Ajax) - by El Forum - 04-11-2010, 07:57 PM
Updating my news post (with jquery/Ajax) - by El Forum - 04-11-2010, 08:33 PM
Updating my news post (with jquery/Ajax) - by El Forum - 04-12-2010, 07:55 AM
Updating my news post (with jquery/Ajax) - by El Forum - 04-12-2010, 08:03 AM
Updating my news post (with jquery/Ajax) - by El Forum - 04-12-2010, 08:22 AM
Updating my news post (with jquery/Ajax) - by El Forum - 04-12-2010, 10:12 AM
Updating my news post (with jquery/Ajax) - by El Forum - 04-12-2010, 01:24 PM
Updating my news post (with jquery/Ajax) - by El Forum - 04-12-2010, 01:35 PM
Updating my news post (with jquery/Ajax) - by El Forum - 04-12-2010, 01:43 PM



Theme © iAndrew 2016 - Forum software by © MyBB