Validate occupation type
//validate occupation type
function occupation_type(){
if(document.getElementById("salaried").checked==false && document.getElementById("selfemployed").checked==false){
alert("Please select type of occupation");
}
}
Validate Salary
//validate the salary
function validate_salary(){
let salary = document.getElementById("salary");
if(salary<1000 || salary>1000000){
alert("Please enter a valid salaary between 1000 and 1000000")
}
}
Next, we need to validate the phone number field.
//validate the phone number
function validate_phno(){
let phno = document.getElementById("number");
if(number.length<10){
alert("Please enter valid phone number with 10 digits"); digits");
}
}
Now, we have setup the validation for the client side input fields.