Sorry, my typo, the else line should have read (note the missing brace)
return true;
} else {
alert("Passwords did not match");
Please note you need to turn on error reporting for scripts in IE or your
chosen browser - doing so would have told you the line which had
Attach onsubmit="return checkpasswords()" to your form tag.
function checkpasswords() {
df=document.forms["DisplayUser"];
if (df["password1"].value==df["password2"].value) {
// Passwords matched, clear password2, allow form to submit
df["password2"].value=""