Guest User

Untitled

a guest
Jan 25th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.71 KB | None | 0 0
  1. <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
  2. pageEncoding="ISO-8859-1" errorPage="Error.jsp"%>
  3. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  4. <html>
  5. <head>
  6. <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
  7. <script type="text/javascript">
  8. function validate() {
  9. var uname = document.getElementById("uname").value;
  10. var email = document.getElementById("email").value.indexof('@');
  11. var pass = document.getElementById("pass").value;
  12. var rpass = document.getElementById("rpass").value;
  13. submitOK = true;
  14.  
  15. if (uname.length == 0) {
  16. alert("Username cannot be empty")
  17. submitOK = false;
  18. }
  19. if (email == -1) {
  20. alert("Not a valid email");
  21. submitOK = false;
  22. }
  23. if (pass.length === 0) {
  24. alert("Password cannot be empty");
  25. submitOK = false;
  26. }
  27. if (pass != rpass) {
  28. alert("passwords don't match");
  29. submitOK = false;
  30. }
  31. return submitOK;
  32. }
  33. </script>
  34. <title>Register</title>
  35. </head>
  36. <body>
  37. <h1>Register</h1>
  38. <br />
  39. <form action="RegInt.jsp" method="post" onsubmit="return validate()">
  40. Enter UserName : <input type="text" name="uname" id="uname" value='${ param.uname}'placeholder="Enter Name" ><br/><br/>
  41. Enter Email: <input type="email" name="email" id = "email" value='${param.email}'placeholder="Enter Email"><br/><br/>
  42. Enter Password: <input type="password" name="pass" id = "pass" value='${param.pass}'placeholder="Enter password"><br/><br/>
  43. Repeat Password: <input type="password" name="rpass" id = "rpass" value='${param.rpass}'placeholder="Repeat Password"/><br/>
  44. <br/><br/>
  45. <input type="submit"/>
  46. </form>
  47. <h4>${errorMsg}</h4>
  48.  
  49. </body>
  50. </html>
Add Comment
Please, Sign In to add comment