Author Topic: Compliance issue in classes/ps_userfield.php  (Read 5403 times)

doorknob

  • Jr. Member
  • **
  • Posts: 151
Compliance issue in classes/ps_userfield.php
« on: August 26, 2008, 02:28:17 am »
The javascript at lines 505 to 523 causes an xhtml compliance issue. I changed it from:
Code: [Select]
    echo '<script type="text/javascript">
   function showFields( show, fields ) {
    if( fields ) {
var i;
    for (i=0; i<fields.length;i++) {
    if( show ) {
    document.getElementById( fields[i] + \'_div\' ).style.display = \'\';
    document.getElementById( fields[i] + \'_input\' ).style.display = \'\';
    } else {
    document.getElementById( fields[i] + \'_div\' ).style.display = \'none\';
    document.getElementById( fields[i] + \'_input\' ).style.display = \'none\';
    }
    }
    }
   }
   try {
    showFields( document.getElementById( \'register_account\').checked, new Array(\'username\', \'password\', \'password2\') );
   } catch(e){}
   </script>';
to
Code: [Select]
    echo '<script type="text/javascript">
//<![CDATA[
   function showFields( show, fields ) {
    if( fields ) {
var i;
    for (i=0; i<fields.length;i++) {
    if( show ) {
    document.getElementById( fields[i] + \'_div\' ).style.display = \'\';
    document.getElementById( fields[i] + \'_input\' ).style.display = \'\';
    } else {
    document.getElementById( fields[i] + \'_div\' ).style.display = \'none\';
    document.getElementById( fields[i] + \'_input\' ).style.display = \'none\';
    }
    }
    }
   }
   try {
    showFields( document.getElementById( \'register_account\').checked, new Array(\'username\', \'password\', \'password2\') );
   } catch(e){}
   //]]>
   </script>';
to hide the js and the issue was resolved.

Regards
Phil