I'm missing something here.
I have a form dynamically loading a form using jquery where .click() pulls in a $.post query that outputs the form with some specific data to .html().
I'm now trying to serialize the data from this form and it's not giving me anything. What am I doing wrong?
Code inserting form:
$(".edit").click(function(){
var mid = $(this).attr("uid");
$.post("inc/menu_mod.php", { page: "edit",menu_id: mid, sender: 'sent'}, function(data){
$('#menu_mod').html(data);
});
});
开发者_运维问答
My attempt to serialize:
$(".update_menu").live('click', function(){
alert("this fires, so I know it's working");
var form = $('#menu_form form').serialize();
alert(form);
});
Thanks in advance!
I suspect your selector should be var form = $('#menu_form').serialize();
because menu_form
is the id
of the form.
精彩评论