<%@ taglib uri="/struts-tags" prefix="ww" %>
<ww:set name="hasConfirmPassword">${param.hasConfirmPassword}</ww:set>
function wireEditPasswordEvents() {
    var $cancelEditPassword = AJS.$("#cancel-edit-password");
    var $editPassword = AJS.$("#edit-password");
    var $ldapPassword = AJS.$("#${param.passwordFieldId}");
    <ww:if test="#hasConfirmPassword == 'true'">
    var $confirmPassword = AJS.$("#passwordConfirm");
    $confirmPassword.val("****");
    </ww:if>
    $ldapPassword.val("****");
    $editPassword.click(function () {
        $ldapPassword.removeProp("disabled");
        $ldapPassword.val("");
        <ww:if test="#hasConfirmPassword == 'true'">
        $confirmPassword.removeProp("disabled");
        $confirmPassword.val("");
        </ww:if>
        $editPassword.addClass("hidden");
        $cancelEditPassword.removeClass("hidden");
    });
    $cancelEditPassword.click(function () {
        $ldapPassword.prop("disabled", "disabled");
        $ldapPassword.val("****");
        <ww:if test="#hasConfirmPassword == 'true'">
        $confirmPassword.prop("disabled", "disabled");
        $confirmPassword.val("****");
        </ww:if>
        $editPassword.removeClass("hidden");
        $cancelEditPassword.addClass("hidden");
    });
}