0

I have a jquery code below which I am using to try to get a html form that is displaied in a lightbox on a webpage to post to a php page my issue seems to be that when I click the "save" button it is not executing the jquery code below Can someone let me know if they see any errors in my below code

thanks

 $("#b_popup_4").dialog({autoOpen: false, 
                            modal: true,
                            width: 400,
                            buttons: {                            
                                "Save": function() {
                                    $.post('../includes/additem.inc.php', $('#additemform').serialize());
                                    //$( this ).dialog( "close" );
                                },
                                Cancel: function() {
                                    $( this ).dialog( "close" );
                                }
    }});
2
Contributors
2
Replies
4
Views
4 Years
Discussion Span
Last Post by jayreis
Featured Replies
  • 2

    Heres one i got: $.post("http://www.example.co.uk/test.php",{sid:sid,type:type}, function(data){ $('.jq_counttotal').html(data); } ); Looks like yours is missing the "what to do when got page" function buttons: { "Save": function() { $.post('../includes/additem.inc.php', $('#additemform').serialize(), function(data){ alert(data); } ); }, Cancel: function() { $( this ).dialog( "close" ); } } Read More

2

Heres one i got:

$.post("http://www.example.co.uk/test.php",{sid:sid,type:type},
        function(data){
            $('.jq_counttotal').html(data);
        }
    );

Looks like yours is missing the "what to do when got page" function

buttons: {                            
    "Save": function() {
        $.post('../includes/additem.inc.php', $('#additemform').serialize(), 
            function(data){
                alert(data);
            }
        );
    },
    Cancel: function() {
        $( this ).dialog( "close" );
    }
}

Edited by Biiim: left url in

Comments
Nice Answer!
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.