$("#sbtBtn").click(function() {
if($("input[name=license_code]").val()) {
$
("#formOne").submit();
} else if ($("input[name=referred_by_text]").val() && $("input[name=broker_text]").val() && $("input[name=email1]").val()) {
$
("#formTwo").submit();
}
else {
//need help getting this added as an error message
alert
("Please fill out either the returning user or new user form");
}
});
$
("#formOne").submit(function() {
//need to put validation and AJAX submit here
});
$
("#formTwo").submit(function() {
//need to put validation and AJAX submit here
});
I appreciate any help, as Ive only been successful with AJAX forms that don't share a button before. thanks!
also, how would I add a fourth conditional that if all elements are filled out, display error message "You can only submit one at a time"