I have a form in which it is dynamically created using the append
method. The result is something in this format:
$('#form').append("<tr><td class='td-min'><input value='"+item.role+"'"+
+" name='"+item.prefix+"' type='checkbox'/> "+item.role+"</td></tr>'");
Above would be basically a form item, in which a list of items is generated dynamically.
Below, using AJAX, this is how I want to write to the database, but I do not know how to retrieve the values of checkbox
. See:
jQuery('#form').submit(function(){
var dados = jQuery(this).serialize();
jQuery.ajax({
type: "POST",
url: "http://api.server.com/resgata",
success: function( data )
{
}
});
return false;
});
How to retrieve values of the% dynamic% (both checked and unchecked ) on the form using the checkbox's
method? Is it possible?