Skip to content

Instantly share code, notes, and snippets.

@stakes
Created January 18, 2011 07:49
Show Gist options
  • Save stakes/784109 to your computer and use it in GitHub Desktop.
Save stakes/784109 to your computer and use it in GitHub Desktop.
form validation
$("#volly_form").validate({
errorPlacement: function(error) {
$("span.error_container").html("Please double-check that you\'ve filled in both fields and provided a U.S. area code and mobile number.");
},
submitHandler: function() {
var request_data = {
full_name: $('#new_volly_full_name').val(),
phone: $('#new_volly_phone').val()
};
$.ajax({
type: 'POST',
url: 'landing/create_volly',
data: request_data,
success: function(r){
// $('#new_volly_full_name').val('');
// $('#new_volly_phone').val('');
$('#volly_form_container').empty();
$('#volly_form_container').append("<h3>Your Volly has been created! You will receive a text from Volly.</h3><p class=\"help\">To add people to the conversation, reply with <strong><em>*add Name #</em></strong> (Ex: <em>*add John 4155551212</em>)</p><p class=\"help\">For help, just reply <strong><em>*help</em></strong></p>");
}
});
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment