title: Javascript Password Change Form Validation doesn't work on IE8
body: <p>got this function to validate two fields from a changing password form and it's doesn't seem to work at IE8. FF, Opera, Safari and Chrome work.</p>
  
  <pre><code>function chk_form_pw()
  {
   if(document.getElementById('new_passwd').value == '')
   {
    alert("&lt;?php _e('Please enter New Password') ?&gt;");
    document.getElementById('new_passwd').focus();
    return false;
   }
   if(document.getElementById('new_passwd').value.length &lt; 5 )
   {
    alert("&lt;?php _e('Please enter New Password minimum 5 chars') ?&gt;");
    document.getElementById('new_passwd').focus();
    return false;
   }
   if(document.getElementById('cnew_passwd').value == '')
   {
    alert("&lt;?php _e('Please enter Confirm New Password') ?&gt;");
    document.getElementById('cnew_passwd').focus();
    return false;
   }
   if(document.getElementById('cnew_passwd').value.length &lt; 5 )
   {
    alert("&lt;?php _e('Please enter Confirm New Password minimum 5 chars') ?&gt;");
    document.getElementById('cnew_passwd').focus();
    return false;
   }
   if(document.getElementById('new_passwd').value != document.getElementById('cnew_passwd').value)
   {
    alert("&lt;?php _e('New Password and Confirm New Password should be same') ?&gt;");
    document.getElementById('cnew_passwd').focus();
    return false;
   }
  }
  </code></pre>
  
  <p>This is the form:</p>
  
  <pre><code>&lt;form name="registerform" id="registerform" action="&lt;?php echo get_option( 'siteurl' ).'/?page=account&amp;chagepw=1'; ?&gt;" method="post"&gt;
  &lt;p&gt;&lt;label&gt;&lt;?php _e('New Password'); ?&gt; &lt;span class="indicates"&gt;*&lt;/span&gt;&lt;/label&gt;&lt;/p&gt;
  &lt;p&gt;&lt;input type="password" name="new_passwd" id="new_passwd"  class="lostpass_textfield" /&gt;&lt;/p&gt;
  &lt;p&gt;&lt;label&gt;&lt;?php _e('Confirm New Password'); ?&gt; &lt;span class="indicates"&gt;*&lt;/span&gt;&lt;/label&gt;&lt;/p&gt;
  &lt;p&gt;&lt;input type="password" name="cnew_passwd" id="cnew_passwd"  class="lostpass_textfield" /&gt;&lt;/p&gt;
  &lt;p&gt;&lt;input type="submit" name="Update" onclick="return chk_form_pw();" value="&lt;?php _e('Update Password') ?&gt;" class="btn grey"/&gt;&lt;/p&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>And here is the chagepw=1 thing:</p>
  
  <pre><code>&lt;?php
  if($_POST)
  {
      if($_REQUEST['chagepw'])
      {
          $new_passwd = $_POST['new_passwd'];
          if($new_passwd)
          {
              $user_id = $current_user-&gt;data-&gt;ID;
              wp_set_password($new_passwd, $user_id);
              $message1 = "Password Changed successfully.You need to sign back in.";
          }
  
      }else
      {
          $user_id = $userInfo['ID'];
          $user_add1 = $_POST['user_add1'];
          $user_add2 = $_POST['user_add2'];
          $user_city = $_POST['user_city'];
          $user_state = $_POST['user_state'];
          $user_country = $_POST['user_country'];
          $user_postalcode = $_POST['user_postalcode'];
  
          $buser_add1 = $_POST['buser_add1'];
          $buser_add2 = $_POST['buser_add2'];
          $buser_city = $_POST['buser_city'];
          $buser_state = $_POST['buser_state'];
          $buser_country = $_POST['buser_country'];
          $buser_postalcode = $_POST['buser_postalcode'];
          $user_address_info = array(
                              "user_add1"     =&gt; $user_add1,
                              "user_add2"     =&gt; $user_add2,
                              "user_city"     =&gt; $user_city,
                              "user_state"    =&gt; $user_state,
                              "user_country"  =&gt; $user_country,
                              "user_postalcode"=&gt; $user_postalcode,
                              "buser_name"    =&gt; $_POST['buser_fname'].'  '.$_POST['buser_lname'],
                              "buser_add1"    =&gt; $buser_add1,
                              "buser_add2"    =&gt; $buser_add2,
                              "buser_city"    =&gt; $buser_city,
                              "buser_state"   =&gt; $buser_state,
                              "buser_country" =&gt; $buser_country,
                              "buser_postalcode"=&gt; $buser_postalcode,
                              );
          update_usermeta($user_id, 'user_address_info', serialize($user_address_info)); // User Address Information Here
          $userName = $_POST['user_fname'].'  '.$_POST['user_lname'];
          $updateUsersql = "update $wpdb-&gt;users set user_nicename=\"$userName\", display_name=\"$userName\"  where ID=\"$user_id\"";
          $wpdb-&gt;query($updateUsersql);
          $message = "Information Updated successfully.";
      }
  }
  $userInfo = $General-&gt;getLoginUserInfo();
  $user_address_info = unserialize(get_user_option('user_address_info', $user_id));
  $user_add1 = $user_address_info['user_add1'];
  $user_add2 = $user_address_info['user_add2'];
  $user_city = $user_address_info['user_city'];
  $user_state = $user_address_info['user_state'];
  $user_country = $user_address_info['user_country'];
  $user_postalcode = $user_address_info['user_postalcode'];
  $display_name = $userInfo['display_name'];
  $display_name_arr = explode(' ',$display_name);
  $user_fname = $display_name_arr[0];
  $user_lname = $display_name_arr[2];
  $buser_add1 = $user_address_info['buser_add1'];
  $buser_add2 = $user_address_info['buser_add2'];
  $buser_city = $user_address_info['buser_city'];
  $buser_state = $user_address_info['buser_state'];
  $buser_country = $user_address_info['buser_country'];
  $buser_postalcode = $user_address_info['buser_postalcode'];
  $bdisplay_name = $user_address_info['buser_name'];
  $display_name_arr = explode(' ',$bdisplay_name);
  $buser_fname = $display_name_arr[0];
  $buser_lname = $display_name_arr[2];
  
  if($_SESSION['redirect_page'] == '')
  {
      $_SESSION['redirect_page'] = $_SERVER['HTTP_REFERER'];
  }
  if(strstr($_SESSION['redirect_page'],'page=checkout'))
  {
      $login_redirect_link = get_option( 'siteurl' ).'/?page=checkout';
  }
  ?&gt;  
  </code></pre>