We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 28626
    • 87 Posts
    I have double <span class="error"> for some fields in the register page of the login snippet.
    So like this:
    <span class="error"><span class="error">Error message here</span></span>
    



    My register page does not contain any <span class="error"> tags.

    I also checked the whole database for this string with no results except for the register snippet
    $errTpl = $modx->getOption('errTpl',$scriptProperties,'<span class="error">[[+error]]</span>');


    I have no idea where that second one is coming from. I also don’t have the problem for the username/ email / password field only for all the other fields
    It seems to happen only on fields I added myself.
      • 25562
      • 2 Posts
      I have same problem in Register form, password_confirm field
        • 23510
        • 168 Posts
        Same problem here too.
          • 29263
          • 0 Posts
          &errTpl=`[[+error]]` and be happy))
            • 23510
            • 168 Posts
            Hi

            Indeed &errTpl=`[[+error]]` works, removing the formatting and any span tags but what I want is:

            &errTpl=`<span class="error">[[+error]]</span>`


            and when I use that I get the double span tags:

            <label for="fullname"><span class="label">Your full name:</span>
            
            <span class="input"><input name="fullname:required" id="fullname"  type="text" value="" />
              <span class="error"> <span class="error">This field is required.</span></span>
            </span></label>
            
                <label for="rusername"><span class="label">Your E-mail:</span>
            <span class="input"><input name="rusername:email" id="rusername"  type="text" value="" />
              <span class="error">This field is required.</span>
            </span></label>
            
                <label for="rpassword"><span class="label">Password:</span>
            
            <span class="input"><input name="rpassword:required:minLength=6" id="rpassword"  type="password" value="" />
            <span class="error">This field is required.</span>
            </span></label>
            
                <label for="password_confirm"><span class="label">Confirm Password:</span>
            <span class="input"><input name="password_confirm:password_confirm=`rpassword`" id="password_confirm" type="password" value="" />
            <span class="error"> <span class="error">Please confirm your password.</span></span>
            </span></label>
              • 10751
              • 5 Posts
              Hi,

              I think there’s an oversight in lgnvalidator.class.php. At line 265 you have:

                  public function addError($key,$value) {
                      $errTpl = $this->modx->getOption('errTpl',$this->login->config,'<span class="error">[[+error]]</span>');
              


              See the span tag wrapping the [[+error]] placeholder. So this span tag always goes inside whatever template you’re using.
              Just delete the span tag and you should be good to go:
                  public function addError($key,$value) {
                      $errTpl = $this->modx->getOption('errTpl',$this->login->config,'[[+error]]');
              


                • 23510
                • 168 Posts
                good observation!