"The for attribute of the label element must refer to a form control."
Honestly, I don't understand what's wrong with the markup. I've looked through so much of the W3's site and just can't get it.
Help?
HTML:
<form action="process.php" method="post">
<div>
<label for="name">Name</label><br />
<input type="text" value="" name="name" />
</div>
<div>
<label for="email">E-mail</label><br />
<input type="text" value="" name="email" />
</div>
<div>
<label for="message">Message</label><br />
<textarea name="message" cols="30" rows="4"></textarea>
</div>
<div>
<input type="checkbox" value="yes" name="newsletter" />
<label for="newsletter">Subscribe to newsletter</label>
</div>
<div>
<input type="submit" value="Submit" name="subscribe" />
</div>
</form>
You're missing the id
attribute.
So to fix it, for example:
<input type="text" value="" name="email" id="email" />
That's it. Linky.
Thirtydot is correct; there is amissing id in your form. I have added all. Check this:
<form action="process.php" method="post">
<div>
<label for="name">Name</label><br />
<input type="text" id="name" value="" name="name" />
</div>
<div>
<label for="email">E-mail</label><br />
<input type="text" id="email" value="" name="email" />
</div>
<div>
<label for="message">Message</label><br />
<textarea name="message" id="message" cols="30" rows="4"></textarea>
</div>
<div>
<input type="checkbox" id="newsletter" value="yes" name="newsletter" />
<label for="newsletter">Subscribe to newsletter</label>
</div>
<div>
<input type="submit" value="Submit" name="subscribe" />
</div>
</form>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With