Validate Captcha for site with accessibility

1

I'm developing a form that will be accessible. For this, the captcha field I'm doing this way:

 <div class="control-group">
           <div class="controls">
              <?php
              $codigoCaptcha = substr(md5(time()) ,0, 5);
              if(!isset($_SESSION["Captcha"])){
                 $_SESSION["Captcha"] = $codigoCaptcha;
              }
               echo "<div id='captcha'>".$_SESSION["Captcha"]."</div>";
              ?>
              <input type="text" class="form-control" name="Captcha" title="Digite o código <?php echo $_SESSION["Captcha"]; ?>" required />
           </div>
     </div>

....
</html>
<?php unset($_SESSION["Captcha"]); ?>

The screen reader can read the captcha correctly, however if we enter the wrong captcha it sends. Is it possible to create a validation through HTML5 for that case, remembering that the screen reader only reads (as far as I know) the fields with the required?

    
asked by anonymous 11.06.2018 / 03:43

0 answers