codice:
html

<form method="POST" action="ChangePswServlet" onsubmit="return confChangePwd()">
		<table border="0"  >
			<tr><td>Name</td><td><input type="text" name="name"  disabled="disabled" value=<%out.print(name);%>><input type="text" name="r_id"  style="display:none;visibility:hidden;" value=<%out.print(resource_id);%>></td></tr>
			<tr><td>Surname</td><td><input type="text" name="surname"  disabled="disabled" value=<%out.print(surname);%>></td></tr>
			<tr><td>Password</td><td><input type="password" name="psw" id="changePwd"></td></tr>
			<tr><td>Confirm Password</td><td><input type="password" id="changeConfPwd" name="confpsw" onblur="confChangePwd()"></td></tr>
			<tr><<td>email</td><td><input type="text" name="email"  disabled="disabled" value=<%out.print(email);%>></td></tr>
			<tr><td><button type="reset">RESET</button></td><td><button type="submit">UPDATE</button></td></tr>
		</table>
	</form>
codice:
js
function confChangePwd(){
		var pwd=document.getElementById("changePwd").value;
var elem = document.getElementById("changeConfPwd").value
	if ((pwd == null)||(pwd=='') && (elem == null)||(elem=='')){
		alert("passwords null !");
		document.getElementById("changePwd").value="";
		document.getElementById("changeConfPwd").value="";
		return false;
	}

	else if(pwd != elem){
		alert("different passwords !");
		document.getElementById("changePwd").value="";
		document.getElementById("changeConfPwd").value="";
return false;
	}

}