and after some trial and error I managed to redirect to a ‘thank you’ page after a vaild form submission to Simple Form. This has to be done trough an ajax call:
<script src="//code.jquery.com/jquery-1.11.0.min.js"></script>
<script src="//ajax.aspnetcdn.com/ajax/jquery.validate/1.12.0/jquery.validate.min.js"></script>
<script>
$("#contactForm").validate({
rules: {
fullname: "required",
email: {
required: true,
email: true
}
},
submitHandler: function(form) {
$.ajax({
dataType: 'jsonp',
url: "http://getsimpleform.com/messages/ajax?form_api_token=my-secret-token",
data: $("#contactForm").serialize()
}).done(function() {
//callback which can be used to show a thank you message
//and reset the form
window.location.href = "/confirm.html";
});
}
});
</script>
No I’m able to validate a contact form and submit it to the Simple Form service, and then redirect to a ‘thank you’ page, all without any server side code