How can I get the values from the form that is placed in add.php? add.php is a simple file with only one form. Submitting will be done by the following code:
var $addGroup = $('<div></div>')
.load('../view/group/add.php')
.dialog({
autoOpen: false,
modal: true,
title: "Aanmaken groep",
buttons: {
"Ok": function() {
var $groupname = $('#name').val();
alert($groupname);
$(this).dialog("close");
},
Cancel: function() {
$(this).dialog("close");
}
}
});
I need to get the value $groupname from the field with id ‘name’. The current value is undefinied.
Thanks,
$.post('../control/group/add.php', $('#addGroupForm').serialize());was the solution of course, don’t know why I didn’t try that