<?xml version="1.0" encoding="UTF-8"?>
<dynaForm name="changePassword" xmlform_type="NORMAL" width="400px">
  <THETITLE type="title">
    <en><![CDATA[Change password]]></en>
  </THETITLE>
  <DESCRIPTION type="private"/>
  <THEDESCRIPTION type="title" label="@#DESCRIPTION" enableHtml="1">
    <en><![CDATA[@#DESCRIPTION]]></en>
  </THEDESCRIPTION>
  <USR_PASSWORD type="password" size="30" maxlength="32">
    <en><![CDATA[Password]]></en>
  </USR_PASSWORD>
  <USR_PASSWORD_CONFIRM type="password" size="30" maxlength="32">
    <en><![CDATA[Re-Type Password]]></en>
  </USR_PASSWORD_CONFIRM>
  <btnSave type="button" onclick="verifyPassword();">
    <en><![CDATA[Save]]></en>
  </btnSave>
  <PPP_MINIMUN_LENGTH type="hidden"/>
  <PPP_MAXIMUN_LENGTH type="hidden"/>
  <PPP_NUMERICAL_CHARACTER_REQUIRED type="hidden"/>
  <PPP_UPPERCASE_CHARACTER_REQUIRED type="hidden"/>
  <PPP_SPECIAL_CHARACTER_REQUIRED type="hidden"/>
  <JS type="javascript"><![CDATA[

var verifyPassword = function() {
  var oPassword1 = getField('USR_PASSWORD');
  var oPassword2 = getField('USR_PASSWORD_CONFIRM');
  if (oPassword1.value != oPassword2.value) {
    alert('@G::LoadTranslation(ID_NEW_PASS_SAME_OLD_PASS)');
    return;
  }
  var oAux = getField('PPP_MINIMUN_LENGTH');
  if (oAux.value != '') {
    if (oPassword1.value.length < parseInt(oAux.value)) {
      alert('@G::LoadTranslation(ID_PPP_MINIMUN_LENGTH)' + ': ' + oAux.value);
      return;
    }
  }
  var oAux = getField('PPP_MAXIMUN_LENGTH');
  if (oAux.value != '') {
    if (oPassword1.value.length > parseInt(oAux.value)) {
      alert('@G::LoadTranslation(ID_PPP_MAXIMUN_LENGTH)' + ': ' + oAux.value);
      return;
    }
  }
  var oAux = getField('PPP_NUMERICAL_CHARACTER_REQUIRED');
  if (oAux.value != '') {
    var sER = /[0-9]/;
    if (!sER.test(oPassword1.value)) {
      alert('@G::LoadTranslation(ID_PPP_NUMERICAL_CHARACTER_REQUIRED)');
      return;
    }
  }
  var oAux = getField('PPP_UPPERCASE_CHARACTER_REQUIRED');
  if (oAux.value != '') {
    var sER = /[A-Z]/;
    if (!sER.test(oPassword1.value)) {
      alert('@G::LoadTranslation(ID_PPP_UPPERCASE_CHARACTER_REQUIRED)');
      return;
    }
  }
  var oAux = getField('PPP_SPECIAL_CHARACTER_REQUIRED');
  if (oAux.value != '') {
    var sER = /[ºª\\!|"@·#$~%€&¬\/()=\'?¡¿*+\-_.:,;]/;
    if (!sER.test(oPassword1.value)) {
      alert('@G::LoadTranslation(ID_PPP_SPECIAL_CHARACTER_REQUIRED)');
      return;
    }
  }
  oPassword1.form.submit();
};

]]></JS>
</dynaForm>
