Label to a form input field.NET Tip of The Day.org

Posted on April 1, 2008 by (author unknown).
Categories: Contributors.

If you set a label to a form element set the AssociatedControlID property. This will force the label to render as <label> rather than <span>. A benefit of using the AssociatedControlID property is that clicking a label when this property is set automatically changes the form focus to the associated form input.


no comments yet.

Leave a comment

Names and email addresses are required (email addresses aren't displayed), url's are optional.

Comments may contain the following xhtml tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>