<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="ISO-8859-1">
<title>Insert title here</title>
</head>
<body bgcolor="aqua">
	<%
		String s1 = request.getParameter("txt1");
		String a = " ";
		if (s1 != null) {
			for (int i = 0; i < s1.length(); i++) {
				if ((s1.charAt(i) >= 48 && s1.charAt(i) <= 57) || (s1.charAt(i) >= 65 && s1.charAt(i) <= 90)
						|| (s1.charAt(i) >= 97 && s1.charAt(i) <= 122)) {

				} else {
					a = "Password should be Alphanumeric";
					break;
				}
			}
		}
	%>
	<%
		String s2 = request.getParameter("txt2");
		String b = " ";
		if (s2 != null) {
			for (int i = 0; i < s2.length(); i++) {
				if ((s2.charAt(i) >= 48 && s2.charAt(i) <= 57) || (s2.charAt(i) >= 65 && s2.charAt(i) <= 90)
						|| (s2.charAt(i) >= 97 && s2.charAt(i) <= 122)) {

				} else {
					b = "Password should be Alphanumeric";
					break;
				}
			}
		}
	%>
	<%
					if(s1 != s2){
						b = "Password do not match!";	
						
					}
	%>
</head>
<body>
	<h1 align="center">Set new password</h1>
	<form>
		Set password:*<input type="password" name="txt1" id="textbox" required><%=a%><br>
		Confirm password:*<input type="password" name="txt2" id="textbox" required><%=b%><br>
		<input type="submit" value="submit" style="color: red">
	</form>
</body>
</html>