Title: Add for attribute to elements
Last modified: October 4, 2024

---

# Add for attribute to elements

 *  Resolved [Vincenzo Casu](https://wordpress.org/support/users/vincent06/)
 * (@vincent06)
 * [1 year, 8 months ago](https://wordpress.org/support/topic/add-for-attribute-to-elements/)
 * Hi, I want to point out in order to improve the accessibility of the plugin a
   bit, to insert the for attribute in the generation of labels for the various 
   inputs. It takes very little and solves a big problem for those who are less 
   fortunate.
 *     ```wp-block-code
       /***/foreach ($choices as $title => $iconSet) {   $i++;   /***/   $icon = '<i class="fa ' . $iconSet['icon'] . '"></i>';   $inner .= '<label for="kc_' . $i . '_input"><input id="kc_' . $i . '_input" type="radio" name="kc_captcha" value="' . $value . '" />' . $icon . '</label>';}/***/
       ```
   
 * I hope this is something simple to add in the next update soon.
 * I’m waiting for news.

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Thread Starter [Vincenzo Casu](https://wordpress.org/support/users/vincent06/)
 * (@vincent06)
 * [1 year, 8 months ago](https://wordpress.org/support/topic/add-for-attribute-to-elements/#post-18054946)
 * Now that I think about it, even making a test with Lighthouse, maybe it would
   be even better to insert an aria-label attribute on the input field:
 *     ```wp-block-code
       /*****/$i = -1;foreach ( $choices as $title => $image ) {   ++$i;   if ( $i == $human ) {      $value = 'kc_human';   } else {      $value = 'bot';   }   $output .= '<label><input aria-label="' . esc_attr__( 'Choice', 'contact-form-7-image-captcha' ) . ' ' . ( $i + 1 ) . '" type="radio" name="kc_captcha" value="' . $value . '" />' . $image . '</label>';}/*****/
       ```
   
    -  This reply was modified 1 year, 8 months ago by [Vincenzo Casu](https://wordpress.org/support/users/vincent06/).
    -  This reply was modified 1 year, 8 months ago by [Vincenzo Casu](https://wordpress.org/support/users/vincent06/).
 *  Plugin Author [hookandhook](https://wordpress.org/support/users/hookandhook/)
 * (@hookandhook)
 * [1 year, 8 months ago](https://wordpress.org/support/topic/add-for-attribute-to-elements/#post-18055248)
 * Hi there,
 * Thank you for your message.
 * I am currently on holiday (October 4-18, 2024).
 * I will have a look at this topic once I return.
 *  Plugin Author [hookandhook](https://wordpress.org/support/users/hookandhook/)
 * (@hookandhook)
 * [1 year, 7 months ago](https://wordpress.org/support/topic/add-for-attribute-to-elements/#post-18083975)
 * Hi there,
 * I have just released a new version which contains aria-labels for both form types(
   CF7 and WP Forms).
 * Best regards

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Add for attribute to elements’ is closed to new replies.

 * ![](https://ps.w.org/contact-form-7-image-captcha/assets/icon.svg?rev=2970465)
 * [Image CAPTCHA for Contact Form 7 and WPForms by HookAndHook (DSGVO/GDPR)](https://wordpress.org/plugins/contact-form-7-image-captcha/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/contact-form-7-image-captcha/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/contact-form-7-image-captcha/)
 * [Active Topics](https://wordpress.org/support/plugin/contact-form-7-image-captcha/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/contact-form-7-image-captcha/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/contact-form-7-image-captcha/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [hookandhook](https://wordpress.org/support/users/hookandhook/)
 * Last activity: [1 year, 7 months ago](https://wordpress.org/support/topic/add-for-attribute-to-elements/#post-18083975)
 * Status: resolved