password validation

I am trying to validate input from the user.

The problem is that the field has ******** in the password field.

If I validate using javascript, to check for a blank field, it is not blank.

How can I detect that the user has not yet entered a value or the field has been unchanged.

I want to keep the asterisks to keep the password invisible to onlookers.

The html for the field looks like this:

<td><input type="password" name="Password" size="33" maxlength="45" value="{Password}"/></td>

The javascript validation is like this:

if(frm.password.value==""){

alert("Password is a required field and cannot be blank.");

frm.password.focus();

return false;

}

Thanks.

[764 byte] By [threshold_j_toth] at [2007-9-30 19:41:01]
# 1
if it has **** in it, it's not blank... the browser puts a * for every character in the field. I don't know of any browser that shows some *'s in the field when it's empty.
bsampieri at 2007-7-7 0:25:40 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
I know the field is not blank.I am looking for a solution. The field has asterisks, but still the value has not been typed in by the user.There must be some way to detect whether the user has entered any input?
threshold_j_toth at 2007-7-7 0:25:40 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3
it's not blank why? Cuz the user typed something, or cuz it was filled in when the page was shown with some value from the server side? If it's cuz there's a value put in from the server side, then you have to compare the value it started with with the current value.
bsampieri at 2007-7-7 0:25:40 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4
How can I detect the before and after values of the field?
threshold_j_toth at 2007-7-7 0:25:40 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 5
write the "before" value somewhere when the page loads. in a hidden field, in a Javascript variable.
bsampieri at 2007-7-7 0:25:40 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...