| Server IP : 138.197.176.125 / Your IP : 216.73.217.55 Web Server : Apache/2.4.41 (Ubuntu) System : Linux SuiteCRM-8 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 User : root ( 0) PHP Version : 8.3.19 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /proc/self/root/home/binal/ |
Upload File : |
var emailRegex = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
var mobileNumberRegex = /^(\+44\s?7\d{3}|\(?07\d{3}\)?)\s?\d{3}\s?\d{3}$/;
$("#email").change(function() {
var email = $(this).val();
if (!emailRegex.test(email)) {
$("#emailError").html('Please provide a valid email address');
$('#email').val('');
return false;
}else{
$("#emailError").html('');
}//end of else
});
$("#contactUsBtn").click(function(e){
e.preventDefault();
var name = email = reCaptchaResponse = '';
if($.trim($('#name').val()) != ''){
name = $.trim($('#name').val());
$("#nameError").html('');
}else{
$("#nameError").html('First Name field is required');
}//end of else
if($.trim($('#email').val()) != ''){
email = $.trim($('#email').val());
$("#emailError").html('');
}else{
$("#emailError").html('Email field is required');
}//end of else
if(getGoogleCaptchResponse('contactUsForm') != ''){
reCaptchaResponse = getGoogleCaptchResponse('contactUsForm');
$("#captchaError").html('');
}else{
$("#captchaError").html('Plese check on the reCAPTCHA box.');
}//end of
if(name && email && reCaptchaResponse){
$("#overlay").show();
/*var formData = new FormData();
formData.append("name", name);
formData.append("email", email);
formData.append("message", message);*/
//formData.append('reCaptchaResponse', reCaptchaResponse);
const formData = $('#contactUsForm').serialize();
$.ajax({
url: "contactUsSendMail.php",
type: "POST",
data: formData,
success: function(response) {
$("#overlay").hide();
if(response == 0){
$('#contactUSFormError').html("Robot verification failed, please try again.");
$('#contactUsFormSuccess').html('');
}else if(response == 1){
$('#contactUsFormSuccess').html("Email sent Successfully!");
$('#contactUSFormError').html('');
}else{
$('#contactUSFormError').html(response);
$('#contactUsFormSuccess').html('');
}//end of else
grecaptcha.reset();
//console.log(response);
$("#contactUsForm").trigger("reset");
window.scrollTo(0,200);
//alert(response);
}//end of success
});//end of ajax
}//end of if
});
//Get Google Captcha Response
function getGoogleCaptchResponse(formId){
var values = {};
$.each($("#"+formId).serializeArray(), function (i, field) {
values[field.name] = field.value;
});
//Value Retrieval Function
var getValue = function (valueName) {
return values[valueName];
};
//Retrieve the Values
var reCaptchaResponse = getValue("g-recaptcha-response");
return reCaptchaResponse;
}//end of function