/**
* sendmail.js v1.0.0 by @svk software corporation
* Copyright 2014.
* http://www.svksoftware.com
*/
$(document).ready(function () {
var n = $('#name');
var e = $('#email');
var m = $('#comment');
function fnSendMail() {
$.ajax({
type: "POST",
url: "SendMail.aspx/Send",
data: "{n:'" + n.val() + "',e:'" + e.val() + "',m:'" + m.val() + "'}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (msg) {
//alert(msg.d);
$('.form').html("
" + msg.d + "
");
}
});
}//function fnSendMail() {
$("#submit").click(function () {
var isValid = true;
//$('input[type="text"]').each(function () {
//$('.required').each(function () {
$('#hello .required').each(function () {
if ($.trim($(this).val()) == '') {
isValid = false;
$(this).css({
"border": "1px solid red",
//"background": "#FFCECE"
});
}
else {
$(this).css({
"border": "",
//"background": ""
});
}
});
if (isValid == false)
e.preventDefault();
else
fnSendMail();
//if ($.trim(n.val()) == '') {
// alert('To send us a message you must enter your name!');
// return false;
//}
//if ($.trim(e.val()) == '') {
// alert('To send us a message you must enter your return email address!');
// return false;
//}
//if ($.trim(m.val()) == '') {
// alert('To send us a message you must type a message, duh!!');
// return false;
//}
//fnSendMail();
});//$("#submit").click(function () {
});//$(document).ready(function () {