</div
function isEmail(email) {
const re = /^(([^()[\]\\.,;:\s@"]+(\.[^()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
return re.test(String(email).toLowerCase());
}
function error(msg) {
const error = document.querySelector('#error-form-submition')
error.innerHTML = msg
error.classList.remove('active')
error.classList.add('active')
window.scrollTo(0, 0)
//document.location.href = '#error-form-submition'
}
const btn = document.querySelector('#send-contact')
btn.addEventListener('click', (e) => {
e.preventDefault()
if (document.querySelector('#contact-form input#first_name').value.length > 0) {
if (document.querySelector('#contact-form input#last_name').value.length > 0) {
if (document.querySelector('#contact-form input#email').value.length > 0) {
if (document.querySelector('#contact-form input#company').value.length > 0) {
if (document.querySelector('#contact-form textarea').value.length > 0) {
if (isEmail(document.querySelector('#contact-form input#email').value)) {
if (document.querySelector('#contact-form input#scales').checked) {
//console.log('ok')
document.querySelector('#contact-form').submit();
} else {
error("You must accept our conditions before submitting this form.")
}
}
else {
console.log(document.querySelector('#contact-form input#email').value)
error("The format of the submitted e-mail address is not valid.")
}
}
else {
error("You must add a message before submitting this form.")
}
}
else {
error("You must fill in your company name before submitting this form.")
}
}
else {
error("You must fill in your email before submitting this form.")
}
}
else {
error("You must fill in your last name before submitting this form.")
}
}
else {
error("You must fill in your first name before submitting this form.")
}
})
2. You are a Sofacto customer needing help using the app ?
Cookies are small files that are stored on your browser. We use cookies and similar technologies to ensure our website works properly. You can choose whether or not you want to consent to our use of cookies through the options below.
You can learn more about how we use cookies by visiting our privacy policy page. AcceptNoPrivacy policy