Skip to content

Instantly share code, notes, and snippets.

Created April 10, 2020 15:24
What would you like to do?
<!DOCTYPE html>
<meta charset="UTF-8">
<title>Formulario de contacto</title>
<script src=""></script>
<script src=""></script>
<form id="contact-form">
<h2>Formulario de contacto</h2>
<label>Nombre<br><input type="text" name="nombre"></label><br>
<label>Email<br><input type="email" name="email"></label><br>
<label>Comentarios<br></label><textarea name="comentarios" cols=40 rows=5></textarea></label>
<input id="submit-contact-form" type="submit" value="Submit">
(function() {
var $form = $('form#contact-form'), url = '';
$('#submit-contact-form').on('click', function(e) {
var jqxhr = $.ajax({
url: url,
method: "GET",
dataType: "json",
data: $form.serializeObject(),
success: function(data) {
$('body').append("<p style='color:green'>Gracias por tu interés. Contactaremos contigo en breve.</p>");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment