<mt:PasswordValidation>

This tag outputs the JavaScript code to validate the user input. Specify the following attributes:

  • form
    Specify the name attribute of the target <form>, required.
  • password
    Specify the name attribute of the password input field, required.
  • username
    Specify the name attribute of the user name input field, optional.

The following is the example of use in the Community Forum's "New Password Form" global template.


        <mt:var name="screen_id" value="change-password">
        <mt:var name="body_class" value="sign-in">
        <mt:setvarblock name="page_title">Change Password</mt:setvarblock>
        <mt:setvar name="complete" value="1">
        <mt:SetVarBlock name="title"><mt:If name="blog_id"><$mt:BlogName encode_html="1"$>: </mt:If><$mt:Var name="page_title"$></mt:SetVarBlock>

        <$mt:Include module="Simple Header"$>

        <mt:if name="error">
        <mtapp:statusmsg
        id="error"
        class="error"
        can_close="0">
        <mt:var name="error">
        </mtapp:statusmsg>
        </mt:if>

        <script type="text/javascript">
        /* <![CDATA[ */
        <$mt:PasswordValidation form="password_reset_form" password="password" username="username"$>
        /* ]]> */
        </script>

        <form id="password_reset_form" method="post" action="<mt:var name="script_url">">
        <input type="hidden" name="__mode" value="new_pw" />
        <input type="hidden" name="token" value="<mt:var name="token" escape="html">" />
        <input type="hidden" name="email" value="<mt:var name="email" escape="html">" />
        <input type="hidden" name="username" id="username" value="<mt:var name="username" escape="html">" />
        <fieldset>

        <mtapp:setting
        id="name"
        label="New Password"
        hint="Enter the new password. (<$mt:PasswordValidationRule$>)"
        show_hint="1"
        label_class="top-label">
        <input type="password" name="password" id="password" class="text password full" value="<mt:var name="password" escape="html">" />
        </mtapp:setting>

        <mtapp:setting
        id="name"
        label="Confirm New Password"
        label_class="top-label">
        <input type="password" name="password_again" id="password_again" class="text password full" value="<mt:var name="password_again" escape="html">" />
        </mtapp:setting>

        <div class="actions-bar actions-bar-login">
        <button
        type="submit"
        accesskey="s"
        title="Change"
        class="action primary button">
        Change</button>
        </div>

        </fieldset>
        </form>
        <$mt:Include module="Simple Footer"$>
This page was last updated on 2012-10-28, 21:32.