<script>
function validateForm() {
var c = document.forms["sss"]["fname"].value;
if (c == ''){
alert("โปรดกรอกชื่อของท่านค่ะ");
return false;
}
var d = document.forms["sss"]["lname"].value;
if (d == ''){
alert("Please enter your lastname");
return false;
}
var e = document.forms["sss"]["old"].value;
if (e == '' ){
alert("Please enter your age");
return false;
}
var x = document.forms["sss"]["email"].value;
var atpos = x.indexOf("@");
var dotpos = x.lastIndexOf(".");
if (atpos<1 || dotpos<atpos+2 || dotpos+2>=x.length) {
alert("Not a valid e-mail address");
return false;
}
var a = document.forms["sss"]["phone"].value;
if (a < 10){
alert("Not a valid phone number");
return false;
}
var b = document.forms["sss"]["no"].value;
if (b < 10){
alert("Not a valid The 1 card number");
return false;
}
var f = document.forms["sss"]["money"].value;
if (f == 'NOT CHOOSE'){
alert("Please select your salary");
return false;
}
}
</script>