| Server IP : 103.234.187.230 / Your IP : 216.73.216.216 Web Server : Apache System : Linux lserver42043-ind.megavelocity.net 3.10.0-1160.108.1.el7.x86_64 #1 SMP Thu Jan 25 16:17:31 UTC 2024 x86_64 User : apache ( 48) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/html/v2.hellogtx.com/backup/public/visa/js/ |
Upload File : |
$(document).ready(function () {
$('.talktous input[name="mobile"]').keypress(function (e) {
if (e.which !== 8 && e.which !== 0 && (e.which < 48 || e.which > 57)) {
return false;
}
});
$(".talktous").on('submit', function (e) {
e.preventDefault();
var formname = $(this).attr('name');
var msgError = (formname === 'talktous_footer') ? 'errormsg' : 'msg';
var data = $(this).serialize();
var EmailReg = new RegExp(/^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/);
if ($('.talktous input[name="name"]').val() == '') {
$('.' + msgError).html('Please enter your name');
$('.talktous input[name="name"]').focus();
return false;
}
if ($('.talktous input[name="email"]').val() == '') {
$('.' + msgError).html('Please enter your email id');
$('.talktous input[name="email"]').focus();
return false;
}
if (!EmailReg.test($('.talktous input[name="email"]').val())) {
$('.' + msgError).html('Please enter valid email address!!!');
$('.talktous input[name="email"]').focus();
return false;
}
if ($('.talktous input[name="mobile"]').val() == '') {
$('.' + msgError).html('Please enter your Mobile');
$('.talktous input[name="mobile"]').focus();
return false;
}
if (!$.isNumeric($('.talktous input[name="mobile"]').val())) {
$('.' + msgError).html('Mobile should be numeric!!');
$('.talktous input[name="mobile"]').focus();
return false;
}
if ($('.talktous input[name="mobile"]').val().length != '10') {
$('.' + msgError).html('Mobile should be 10 digit?');
$('.talktous input[name="mobile"]').focus();
return false;
}
if ($('.talktous textarea[name="message"]').val() == '') {
$('.' + msgError).html('Please enter your query!');
$('.talktous textarea[name="message"]').focus();
return false;
}
if (($(".talktous input[name='authoriseme']:checked").length) <= 0) {
$('.' + msgError).html('Please accept and authorize me for contact you?');
$('.talktous input[name="authoriseme"]').focus();
return false;
}
$('.' + msgError).html('');
$('.sending').attr('disabled', 'disabled');
$.ajax({url: SITEURL + 'cms/index/sendenquiry', type: 'POST', data: data, dataType: 'json', beforeSend: function () {
$('.sending').html('<i class="ace-icon fa fa-spinner fa-spin orange bigger-125"></i> Sending...');
}, success: function (result) {
if (result.status) {
$('.' + msgError).html('Your message sent successfully.').css({'color': '#5cb85c'});
// $('#successmsg').html("<center>Thank you <br>Your enquiry send successfully.<br> we'll be in touch with you shortly.</center>");
$('.talktous input, .talktous textarea').val('');
$('.talktous input[name="authoriseme"]').attr('checked', false);
$('.sending').attr('disabled', false).html('Send');
setTimeout(function () {
$('.' + msgError).html('').css({'color': '#ff0000'});
}, 5000);
} else {
$('.sending').html('Send').attr('disabled', false);
$('.' + msgError).html(result.message)
}
//window.location.href = SITEURL+'thankyou.html';
window.open(SITEURL+'thankyou.html','_blank' );
}, error: function (result) {
$('.sending').html('Send').attr('disabled', false);
alert('Some error occured.');
}});
});
});