Flash Form with CF Validation - Not working
I've been trying to add some password validation to an existing Flash form within a CF app - I'm re-using some code in a CFC that I'm already using for a standard HTML Change Password form - which is working fine
Within the Admin section of the app there is a set of User Admin forms all held within a <cfformgroup> tags and inside a Flash form - I've tried adding the code as a call before the form is processed but it only picks up certain error conditions and I've tried putting the validation on the Submit button as an onClick event - Which is also ignored
What is the best way to do this properly - It seems such a simple task that is completely throwing me (I'm a recent convert to Coldfusion from Java so still feeling my way to a certain extent!)
My code call from the process form is
<cfif isdefined("NewPassword") and NewPassword NEQ "">
<cfinvoke component="global.util.PasswordUtils"
method="CheckPasswordStrength"
namedUser="#UserName#"
oldPassword="#Password#"
newPassword="#NewPassword#"
confirmPassword="#ConfirmPassword#"
returnvariable="passswordOK"
/>
And the code within the submit onClick event is:
onClick="if( NewPassword.length > 0 ){
if( NewPassword.length < 8 ){
alert('Password must be at least 8 characters.');
}else if(hash(NewPassword)==Password){
alert('The old and new passwords cannot be the same, please try again');
}else if(UserName == NewPassword){
alert('The username and password cannot be the same, please try again');
}else if(NewPassword != ConfirmPassword){
alert('Password and Confirmation must match, please try again');
}else {
submitForm();
}">
Any help would really be appreciated
Thanks
