Skip to content

Instantly share code, notes, and snippets.

@ricardosiri68
Created January 7, 2015 03:45
Show Gist options
  • Select an option

  • Save ricardosiri68/2a61dc0a90ec7f7b36f9 to your computer and use it in GitHub Desktop.

Select an option

Save ricardosiri68/2a61dc0a90ec7f7b36f9 to your computer and use it in GitHub Desktop.
<link href="c-style.css" rel="stylesheet" type="text/css" />
<!--[if IE]><script type="text/javascript" src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js'></script>
<script src='../js/jquery.color-RGBa-patch.js'></script>
<script src='../js/script.js'></script>
<script src="jquery.form.js" type="text/javascript"></script>
<script src="jquery.validate.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#mensaje";).hide();
$("#frmContact";).validate({
event: "blur",rules: {'nombre': "required",'apellido': "required",'email': "required email",'telefono': "required number",'consulta': "required",'archivo': "required"},
messages: {'nombre': "Por favor indica tu nombre",'apellido': "Por favor indica tu apellido",'email': "Por favor, indica una direcci&oacute;n de e-mail v&aacute;lida",'telefono': "Por favor indica un numero de telefono v&aacute;lido",'consulta': "Por favor, déjanos un mensaje!"},
debug: true,errorElement: "label",
submitHandler: function(form){
$("#mensaje";).show();
$("#mensaje";).html("<img src='ajax-loader.gif' style='vertical-align:middle;margin:0 10px 0 0' /><strong>Enviando mensaje...</strong>";);
$.ajax({
type: "POST",
url:"envio.php",
contentType: "application/x-www-form-urlencoded",
processData: true,
data: "nombre="+escape($('#ContactName').val())+"&apellido="+escape($('#ContactLastName').val())+"&email="+escape($('#ContactRecipient').val())+"&telefono="+escape($('#ContactLastName').val())+"&empresa="+escape($('#Telephone').val())+"&mensaje="+escape($('#ContactMessage').val()),
success: function(msg){
$("#mensaje";).html("<strong>Mensaje enviado correctamente. Gracias por contactarse con nosotros. En breve recibir&aacute;s nuestra respuesta. Gracias!</strong>";);
document.getElementById("ContactName";).value="";
document.getElementById("ContactLastName";).value="";
document.getElementById("ContactRecipient";).value="";
document.getElementById("Telephone";).value="";
document.getElementById("ContactMessage";).value="";
setTimeout(function() {$('#mensaje').fadeOut('fast');}, 3000);
}
});
}
});
});
</script>
<script type="text/javascript">
$(function() {
$("#wrap img";).lazyload({
placeholder : "images/trans.gif",
effect : "fadeIn",
container: $("#wrap";)
});
})
</script>
<script type="text/javascript">
window.addEvent('domready',function() {
new Fx.SmoothScroll({
duration: 1500
},window);
});
</script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-33780539-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment