Form result:
The HTML from ajax-loaded-content.html
And the jQuery to load the content:
After loading the content, form.customRadioCheckbox() is called to replace radios & checkboxes
$(function() {
var link = $('#load_content'),
url = link.attr('href'),
container = $('#demo_ajax');
link.click(function(e) {
e.preventDefault();
container.load(url, function() {
var form = $('#form');
$('#html_output').text(form.parent().html());
// customize radio and checkbox for the loaded content
// and handle the submit function to show the results
form.customRadioCheckbox()
.submit(function(e) {
e.preventDefault();
$('#result').html(form.serialize());
});
});
});
});