ajax form submit with validation in php code example
Example 1: javascript submit a form
document.getElementById("myFormID").submit();
Example 2: create a form and submit it dynamically jquery
$(function() {
$('<form action="form2.html"></form>').appendTo('body').submit().remove();
});