I can\'t find anything in the HTML5 doc that talks about nested forms. I\'m sure it\'s listed on some page, somewhere (perhaps a changelog
If they were supported then something like this would work:
$('button').on('click', function(e) {
var form = $(this).parents('form');
e.preventDefault();
if(!form) {
form = $(this);
}
$('#output').val('from '+form.attr('id')+'\n'+form.serialize());
});
However because it is not officially supported you can look see the browser is preventing it (closing what it assumes are open-ended form elements). One alternative would be to have a single form but add data attributes to the individual inputs so JavaScript can collect the sub fields you want and manually build a POST from them.