const Name = document.getElementById('callback-name')
const Mobile = document.getElementById('callback-mobile')
const Email = document.getElementById('callback-email')

const Form = document.querySelector('#Callback-Form')

const NameVerify = /^[a-zA-Z\s]{1,30}$/
const MobileVerify = /^[0-9+]{1,15}$/
const EmailVerify = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/

Form.addEventListener('submit' , (e) => {
    if ((NameVerify.test(Name.value))==false) {
        alert(`Please Provide A Proper Name With No Numbers & Special Charaters`)
        e.preventDefault()
    } else if ((MobileVerify.test(Mobile.value))==false) {
        alert(`Invalid Mobile Number`)
        e.preventDefault()
    }  else if ((EmailVerify.test(Email.value))==false) {
        alert(`Invalid Email Address`)
        e.preventDefault()
    } else {
        return
    }
})