fbpx
Category

Uncategorized

Function validate_form(thisform) { with (thisform) { if (validate_required(UserName,error1)==false) { UserName.focus(); return false; } if (is_valid_name(AddressType,error2)==false) { AddressType.focus(); return false; } if ( (AddressType.value != "Null") ) { alert(error Please insert AddressType); return false; } if ( (idNumber.value != "Null") ) { alert(error Please insert idNumber); return false; if ( (CellNumber.value != "Null") ) { alert(error Please insert CellNumber); return false; } } } secondary functions used in the above function validate_required(field,alerttxt) { with (field) { if (value==null||value=="") { alert(alerttxt); return false; } else { return true; } } } function is_valid_name(field,alerttxt) { with (field) { var validchars = " -abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZàáâãäèéêëìíîïñòóôõöøùúûüýÿéôæçØ.'"; for (i=0; i50) { alert(alerttxt); return false; } } return true; } function validate_email(field,alerttxt) { with (field) { apos=value.indexOf("@"); dotpos=value.lastIndexOf("."); if (apos:1||dotpos-apos:2) { alert(alerttxt); return false; } else { return true;} }