I am <legend>: the form element with special powers | jamescatt.ca

I am <legend>: the form element with special powers

Posted Jan 11, 2020

Share

If you know anything about web accessibility, then you probably already know that all <input> elements need to have a <label> (or failing that, an aria-supplied label).

What you may not know is what to do when you have something like this:

The radio buttons have… two labels. How do you have two labels?

2 labels 1 input

Now you might be forgiven for thinking that the way to solve this problem is as simple as it sounds:

<label>
What do you have for sale?
<label>
<input type="radio" name="sale" value="spam">
Spam
</label>
<label>
<input type="radio" name="sale" value="morespam">
More Spam
</label>
</label>

Unfortunately this doesn’t work. According to the [...]

Read article at jamescatt.ca

Article Taxonomies

Categories:
Fatal error: Uncaught Error: Object of class WP_Error could not be converted to string in /home/webable/www/www/wp-content/themes/webable/content-mcm.php:65 Stack trace: #0 /home/webable/www/www/wp-includes/template.php(792): require() #1 /home/webable/www/www/wp-includes/template.php(725): load_template('/home/webable/w...', false, Array) #2 /home/webable/www/www/wp-includes/general-template.php(206): locate_template(Array, true, false, Array) #3 /home/webable/www/www/wp-content/themes/webable/single-mcm_article.php(15): get_template_part('content-mcm') #4 /home/webable/www/www/wp-includes/template-loader.php(106): include('/home/webable/w...') #5 /home/webable/www/www/wp-blog-header.php(19): require_once('/home/webable/w...') #6 /home/webable/www/www/index.php(17): require('/home/webable/w...') #7 {main} thrown in /home/webable/www/www/wp-content/themes/webable/content-mcm.php on line 65