views:

27

answers:

1

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!

A: 

I suspect your selector should be var form = $('#menu_form').serialize(); because menu_form is the id of the form.

Darin Dimitrov
okay, now I feel stupid. doh! Thanks. :)
Aninemity