Look directly at the code
The onsubmit function in the example is the function that is triggered before the form is submitted
function checkform() {
var value = $( "input[name='payWay']:checked").val();
if (value == 1) {
$("#alipayment").submit();
return false;
}
return true;
}
The form will be submitted only if true is returned, otherwise it will not be submitted.