Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function validateForm()
- {
- if (document.getElementById("fname").value==""){
- alert("Please enter your firstname");
- document.getElementById("fname").focus();
- return false;
- }
- if (document.getElementById("lname").value==""){
- alert("Please enter your lastname");
- document.getElementById("lname").focus();
- return false;
- }
- if (isNaN(document.getElementById("postcode").value)){
- alert("Your postcode is not valid");
- document.getElementById("postcode").focus();
- return false;
- }
- if (document.getElementById("email").value.indexOf("@")==-1){
- alert("The Email Address you entered was Invalid");
- document.getElementById("email").focus();
- return false;
- }
- if (document.getElementById("email").value.indexOf(".")==-1){
- alert("The Email Address you entered was Invalid");
- document.getElementById("email").focus();
- return false;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement