Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
- pageEncoding="ISO-8859-1" errorPage="Error.jsp"%>
- <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
- <script type="text/javascript">
- function validate() {
- var uname = document.getElementById("uname").value;
- var email = document.getElementById("email").value.indexof('@');
- var pass = document.getElementById("pass").value;
- var rpass = document.getElementById("rpass").value;
- submitOK = true;
- if (uname.length == 0) {
- alert("Username cannot be empty")
- submitOK = false;
- }
- if (email == -1) {
- alert("Not a valid email");
- submitOK = false;
- }
- if (pass.length === 0) {
- alert("Password cannot be empty");
- submitOK = false;
- }
- if (pass != rpass) {
- alert("passwords don't match");
- submitOK = false;
- }
- return submitOK;
- }
- </script>
- <title>Register</title>
- </head>
- <body>
- <h1>Register</h1>
- <br />
- <form action="RegInt.jsp" method="post" onsubmit="return validate()">
- Enter UserName : <input type="text" name="uname" id="uname" value='${ param.uname}'placeholder="Enter Name" ><br/><br/>
- Enter Email: <input type="email" name="email" id = "email" value='${param.email}'placeholder="Enter Email"><br/><br/>
- Enter Password: <input type="password" name="pass" id = "pass" value='${param.pass}'placeholder="Enter password"><br/><br/>
- Repeat Password: <input type="password" name="rpass" id = "rpass" value='${param.rpass}'placeholder="Repeat Password"/><br/>
- <br/><br/>
- <input type="submit"/>
- </form>
- <h4>${errorMsg}</h4>
- </body>
- </html>
Add Comment
Please, Sign In to add comment