Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Andrzejek on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding alt attribute or LABEL to checkbox in gridview

Status
Not open for further replies.

chicdog

Programmer
Feb 28, 2002
84
US
The application that i'm working on requires 508 compliance and I'm recieving a failure on the checkboxes in the gridview. Is there a way to add an alt attribute or LABEL to a checkbox control in a gridview that's dymanically created?
 
1. What language? c#, vb?
2. can you not use
dynCheckBox.Attributes["title"] = "This Box Does This";
when you create the checkbox?

i dont think there is a valid alt attribute for a checkbox.

if you cant for some reason add the attribute like above, can you post the code for when you create the checkbox?
 
As Adam has already said, there isn't an alt attribute for a checkbox.

A standard checkbox in ASP.NET e.g.
Code:
<asp:CheckBox ID="CheckBox1" runat="server"/>
will render as:
Code:
<input id="CheckBox1" type="checkbox" name="CheckBox1" />
If you add the Text property e.g.
Code:
<asp:CheckBox ID="CheckBox1" runat="server" Text="Test" />
then it will render a label for that checkbox e.g
Code:
<input id="CheckBox1" type="checkbox" name="CheckBox1" /><label for="CheckBox1">Test</label>
That should be enough for a screen reader to know what the checkbox is.


____________________________________________________________
Mark,
[URL unfurl="true"]http://aspnetlibrary.com[/url]

Need help finding an answer? Try the Search Facility or read FAQ222-2244 on how to get better results.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top