Using AJAX to conditionally submit form and using conditional logic to redirect user to thank you page