We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 34632
    • 9 Posts
    Hi! Please, tell to Formit developers:
    for XHTML 1.1. validation(http://validator.w3.org/) Formit with recaptcha, in /core/components/formit/model/recaptcha/formitrecaptcha.class.php we need change this code:

    $opt = $this->getOptions($scriptProperties);
    $html = '<script type="text/javascript">var RecaptchaOptions = '.$this->modx->toJSON($opt).';</script><script type="text/javascript" src="'. $server . 'challenge?k=' . $this->config[FormItReCaptcha::OPT_PUBLIC_KEY] . '"></script>
    <noscript>
    <iframe src="'. $server . 'noscript?k=' . $this->config[FormItReCaptcha::OPT_PUBLIC_KEY] . '" height="'.$opt['height'].'" width="'.$opt['width'].'" frameborder="0" style="width: '.$opt['width'].'px; height: '.$opt['height'].'px;"></iframe>

    <textarea name="recaptcha_challenge_field" rows="3" cols="40"></textarea>
    <input type="hidden" name="recaptcha_response_field" value="manual_challenge"/>
    </noscript>';
    $this->modx->setPlaceholder('formit.recaptcha_html',$html);
    $this->modx->setPlaceholder($scriptProperties['placeholderPrefix'].'recaptcha_html',$html);
    return $html;

    to code:

    $opt = $this->getOptions($scriptProperties);
    $html = '<script type="text/javascript">var RecaptchaOptions = '.$this->modx->toJSON($opt).';</script><script type="text/javascript" src="'. $server . 'challenge?k=' . $this->config[FormItReCaptcha::OPT_PUBLIC_KEY] . '"></script>
    <noscript><div>
    <object data="'. $server . 'noscript?k=' . $this->config[FormItReCaptcha::OPT_PUBLIC_KEY] . '" height="'.$opt['height'].'" width="'.$opt['width'].'" style="width: '.$opt['width'].'px; height: '.$opt['height'].'px;"></object>

    <textarea name="recaptcha_challenge_field" rows="3" cols="40"></textarea>
    <input type="hidden" name="recaptcha_response_field" value="manual_challenge"/></div>
    </noscript>';
    $this->modx->setPlaceholder('formit.recaptcha_html',$html);
    $this->modx->setPlaceholder($scriptProperties['placeholderPrefix'].'recaptcha_html',$html);
    return $html;

    If developer post me, i can send site with example.
      • 34632
      • 9 Posts
      This Code:

      
        $opt = $this->getOptions($scriptProperties);
              $html = '<script type="text/javascript">var RecaptchaOptions = '.$this->modx->toJSON($opt).';</script><script type="text/javascript" src="'. $server . 'challenge?k=' . $this->config[FormItReCaptcha::OPT_PUBLIC_KEY] . '"></script>
      <noscript>
              <iframe src="'. $server . 'noscript?k=' . $this->config[FormItReCaptcha::OPT_PUBLIC_KEY] . '" height="'.$opt['height'].'" width="'.$opt['width'].'" frameborder="0" style="width: '.$opt['width'].'px; height: '.$opt['height'].'px;"></iframe><br />
              <textarea name="recaptcha_challenge_field" rows="3" cols="40"></textarea>
              <input type="hidden" name="recaptcha_response_field" value="manual_challenge"/>
      </noscript>';
              $this->modx->setPlaceholder('formit.recaptcha_html',$html);
              $this->modx->setPlaceholder($scriptProperties['placeholderPrefix'].'recaptcha_html',$html);
              return $html;
      
      


      To Code:

        $opt = $this->getOptions($scriptProperties);
              $html = '<script type="text/javascript">var RecaptchaOptions = '.$this->modx->toJSON($opt).';</script><script type="text/javascript" src="'. $server . 'challenge?k=' . $this->config[FormItReCaptcha::OPT_PUBLIC_KEY] . '"></script>
      <noscript><div>
              <object data="'. $server . 'noscript?k=' . $this->config[FormItReCaptcha::OPT_PUBLIC_KEY] . '" height="'.$opt['height'].'" width="'.$opt['width'].'" style="width: '.$opt['width'].'px; height: '.$opt['height'].'px;"></object><br />
              <textarea name="recaptcha_challenge_field" rows="3" cols="40"></textarea>
              <input type="hidden" name="recaptcha_response_field" value="manual_challenge"/></div>
      </noscript>';
              $this->modx->setPlaceholder('formit.recaptcha_html',$html);
              $this->modx->setPlaceholder($scriptProperties['placeholderPrefix'].'recaptcha_html',$html);
              return $html;
      
      
        • 1343 ☆ A M B ☆
        • 2,213 Posts
        Great catch!

        If you could file the bug here: http://bugs.modx.com/projects/formit

        The developer should hopefully get that addressed for you in the near future.
          Patrick | Server Wrangler
          About Me: Website | Tweets |  MODX Hosting