Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <script>
- <?php
- function Validation()
- {
- var x = document.forms["welcome.php"]["name"].value;
- if (x==null || x=="") {
- alert("Please Enter a User Name!!!");
- return false;
- }
- var y = document.forms["welcome.php"]["email"].value;
- var atpos = y.indexOf("@");
- var dotpos = y.lastIndexOf(".");
- if (atpos<1 || dotpos<atpos+2 || dotpos+2>=y.length) {
- alert("Not a Valid E-mail Address!!!");
- return false;
- }
- var z = document.forms["welcome.php"]["password"].value;
- if (z==null || z=="") {
- alert("Please Enter a Password!!!");
- return false;
- }
- }
- </script>
- </head>
- <body>
- <form action="welcome.php" onsubmit= "return Validation()" method="post">
- Name: <input type="text" name="name"><br>
- E-mail: <input type="text" name="email"><br>
- Password:<input type="text" name="password"><br>
- <input type="submit" value="submit">
- ?>
- </form>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement