Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 0.3.0

Request #15692 Be able to specify an alt attribute
Submitted: 2009-01-20 17:50 UTC
From: raziel057 Assigned:
Status: Open Package: HTML_QuickForm_CAPTCHA (version 0.3.0)
PHP Version: 5.2.6 OS: Win XP
Roadmaps: (Not assigned)    
Subscription  


 [2009-01-20 17:50 UTC] raziel057 (Thomas Lallement)
Description: ------------ Currently, it's not possible to add an "Alt" attribute in the image tag. In the chass HTML_QuickForm_CAPTCHA_Image function toHtml() { .... $html = $tabs.'<a href="'.$this->_options['callback'] .'" target="_blank" ' .$this->_getAttrString($attr) .' onclick="var cancelClick = false; ' .$this->getOnclickJs($imgName) .' return !cancelClick;"><img src="' .$this->_options['callback'].'" name="'.$imgName .'" id="'.$imgName.'" width="'.$this->_options['width'] .'" height="'.$this->_options['height'].'" title="' .htmlspecialchars($this->_options['alt']).'" /></a>'; ... } $this->_options['alt'] is only used for the attribute "title". Could you please add the tag "alt". To be xhtml 1.0 compliant the attribute "alt" must be specified in the tag "img". Thanks Test script: --------------- $options = array( 'alt' => 'test', 'width' => 205, 'height' => 80, 'output' => 'png', 'callback' => ... ); Expected result: ---------------- <img id="QF_CAPTCHA_captcha_question" height="80" width="205" title="test" alt="test" name="QF_CAPTCHA_captcha_question" src="qfcaptcha_image.php?var=Compte.class"/> Actual result: -------------- <img id="QF_CAPTCHA_captcha_question" height="80" width="205" title="test" name="QF_CAPTCHA_captcha_question" src="qfcaptcha_image.php?var=Compte.class"/>

Comments

 [2009-02-08 18:17 UTC] doconnor (Daniel O'Connor)
-Summary: Error W3C +Summary: Be able to specify an alt attribute