tags:

views:

26

answers:

1

I have a change password screen and when the 2 passwords match i need to enable the save button. It works with IE8 + IE7 but fails to enable the button in IE6

        var LblError = document.getElementById('ctl00_cphValNet_LblError');
        var Pwd1 = document.getElementById('ctl00_cphValNet_txtNewPassword')

        var Pwd2 = document.getElementById('ctl00_cphValNet_txtNewPassword2')

        var Change = document.getElementById('ctl00_cphValNet_BtnUpdatePassword')
        // code to check if password matches
        Change.disabled = false;

Any ideas why this is happening

Sp

Could the RegEx be causing the issue?

function IsalphaNumericValidate(alphanumericChar) {
        if (alphanumericChar.length < 6 || alphanumericChar.search(/[^a-zA-Z0-9 ]/g) != -1) {
            return false;
        }
        else {
            var re = /(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{6,}/;
            return re.test(alphanumericChar);

        }           
    }
+2  A: 

instead of

Change.disabled = false;

try

Change.removeAttribute('disabled');

demo

Reigel
Stille the same issue, works fine with ie7 + ie8 + chrome but not ie6.:(
Steven
will I'm pretty sure my demo did work on IE6... view the source code..
Reigel
Your demo works perfect, must be the checking part of my JavaScript.
Steven
Ive added the regex check can you glance over it and see if ive made and errors that ie6 would have issues with?
Steven