How do I Associating a Label to RadioButtonList control so it is 508 compliant? - radiobuttonlist

I have tried several methods to get this control to pass 508 compliance testing, but they all seem to fail. I do not get feedback from the tester’s, only pass/fail.
I suspect is has to do with the table that is automatically rendered around the Radio Buttons. I suspect that the labels must be inside the table, which is not an option with a RadioButtonList. Here are the methods that I have tried and failed.
Fieldset/legend Solution
ASP/NET Page:
<fieldset>
<legend>Review By:</legend>
<asp:RadioButtonList runat="server" ID="FilterType" AutoPostBack="true" Width="100%"
BorderWidth="1" OnSelectedIndexChanged="FilterType_OnSelectedIndexChanged" />
</fieldset>
Rendered HTML:
<fieldset>
<legend>Review By:</legend>
<table id="ctl00_contentBody_FilterType" border="0" style="border-width:1px;
border-style:solid;width:100%;">
<tr>
<td><input id="ctl00_contentBody_FilterType_0" type="radio"
name="ctl00$contentBody$FilterType" value="1"
onclick="javascript:setTimeout('__doPostBack(\'ctl00$contentBody$FilterType$0
\',\'\')', 0)" /><label for="ctl00_contentBody_FilterType_0">Attending MD</label>
</td>
</tr><tr>
<td><input id="ctl00_contentBody_FilterType_1" type="radio"
name="ctl00$contentBody$FilterType" value="2"
onclick="javascript:setTimeout('__doPostBack(\'ctl00$contentBody$FilterType$1
\',\'\')', 0)" /><label for="ctl00_contentBody_FilterType_1">CERMe Review
Types</label></td>
</tr><tr>
<td><input id="ctl00_contentBody_FilterType_2" type="radio"
name="ctl00$contentBody$FilterType" value="3"
onclick="javascript:setTimeout('__doPostBack(\'ctl00$contentBody$FilterType$2
\',\'\')', 0)" /><label for="ctl00_contentBody_FilterType_2">Treating
Specialty</label></td>
</tr><tr>
<td><input id="ctl00_contentBody_FilterType_3" type="radio"
name="ctl00$contentBody$FilterType" value="4"
onclick="javascript:setTimeout('__doPostBack(\'ctl00$contentBody$FilterType$3
\',\'\')', 0)" /><label for="ctl00_contentBody_FilterType_3">Ward Location</label>
</td>
</tr>
</table>
</fieldset>
Using an AssociatedControlID to link the control to label
ASP.Net Page:
<asp:Label ID="lblHiddenReviewType" AssociatedControlID="FilterType" runat="server">
<div>Review Type:</div></asp:Label>
<asp:RadioButtonList runat="server" ID="FilterType" AutoPostBack="true" Width="100%"
BorderWidth="1" OnSelectedIndexChanged="FilterType_OnSelectedIndexChanged" />
Rendered HTML:
<td>
<label for="ctl00_contentBody_FilterType"
id="ctl00_contentBody_lblHiddenReviewType"><div>Review Type:</div></label>
<table id="ctl00_contentBody_FilterType" border="0" style="border-
width:1px;border-style:solid;width:100%;">
<tr>
<td><input id="ctl00_contentBody_FilterType_0"
type="radio" name="ctl00$contentBody$FilterType" value="1"
onclick="javascript:setTimeout('__doPostBack(\'ctl00$contentBody$FilterType$0
\',\'\')', 0)" /><label for="ctl00_contentBody_FilterType_0">Attending MD</label></td>
</tr><tr>
<td><input id="ctl00_contentBody_FilterType_1"
type="radio" name="ctl00$contentBody$FilterType" value="2"
onclick="javascript:setTimeout('__doPostBack(\'ctl00$contentBody$FilterType$1
\',\'\')', 0)" /><label for="ctl00_contentBody_FilterType_1">CERMe Review Type</label>
</td>
</tr><tr>
<td><input id="ctl00_contentBody_FilterType_2"
type="radio" name="ctl00$contentBody$FilterType" value="3"
onclick="javascript:setTimeout('__doPostBack(\'ctl00$contentBody$FilterType$2
\',\'\')', 0)" /><label for="ctl00_contentBody_FilterType_2">Treating
Specialty</label></td>
</tr><tr>
<td><input id="ctl00_contentBody_FilterType_3"
type="radio" name="ctl00$contentBody$FilterType" value="4"
onclick="javascript:setTimeout('__doPostBack(\'ctl00$contentBody$FilterType$3
\',\'\')', 0)" /><label for="ctl00_contentBody_FilterType_3">Ward Location</label>
</td>
</tr>
</table>
</td>
Surround the Control with its own Panel
ASP.Net Page:
<asp:Panel id="pnlRadial" GroupingText="Review Type: " runat="server">
<asp:RadioButtonList runat="server" ID="FilterType" AutoPostBack="true" Width="100%"
BorderWidth="1" OnSelectedIndexChanged="FilterType_OnSelectedIndexChanged" />
</asp:Panel>
Rendered HTML:
<div id="ctl00_contentBody_pnlRadial">
<fieldset>
<legend>Review Type:</legend>
<table id="ctl00_contentBody_FilterType" border="0" style="border-width:1px;border-
style:solid;width:100%;">
<tr>
<td><input id="ctl00_contentBody_FilterType_0" type="radio"
name="ctl00$contentBody$FilterType" value="1"
onclick="javascript:setTimeout('__doPostBack(\'ctl00$contentBody$FilterType$0
\',\'\')', 0)" /><label for="ctl00_contentBody_FilterType_0">Attending MD</label></td>
</tr><tr>
<td><input id="ctl00_contentBody_FilterType_1" type="radio"
name="ctl00$contentBody$FilterType" value="2"
onclick="javascript:setTimeout('__doPostBack(\'ctl00$contentBody$FilterType$1
\',\'\')', 0)" /><label for="ctl00_contentBody_FilterType_1">Reviewer</label></td>
</tr><tr>
<td><input id="ctl00_contentBody_FilterType_2" type="radio"
name="ctl00$contentBody$FilterType" value="4"
onclick="javascript:setTimeout('__doPostBack(\'ctl00$contentBody$FilterType$2
\',\'\')', 0)" /><label for="ctl00_contentBody_FilterType_2">Treating
Specialty</label></td>
</tr><tr>
<td><input id="ctl00_contentBody_FilterType_3" type="radio"
name="ctl00$contentBody$FilterType" value="5"
onclick="javascript:setTimeout('__doPostBack(\'ctl00$contentBody$FilterType$3
\',\'\')', 0)" /><label for="ctl00_contentBody_FilterType_3">Ward Location</label>
</td>
</tr><tr>
<td><input id="ctl00_contentBody_FilterType_4" type="radio"
name="ctl00$contentBody$FilterType" value="3"
onclick="javascript:setTimeout('__doPostBack(\'ctl00$contentBody$FilterType$4
\',\'\')', 0)" /><label for="ctl00_contentBody_FilterType_4">Service Section</label>
</td>
</tr>
</table>
</fieldset>
</div>
Any help would be greatly appreciated !!

I would request that the tester to provide more information than pass/fail, at least what they are using to test. Maybe asking the Section 508 Coordinator to get involved may help some. Your first or second snippet should pass. A compliant solution would look like:
<fieldset>
<legend>Review type</legend>
<table role="presentation"> //bonus for the role, not required
<tr>
<td>
<input id="option1" name="myGroup" type="radio" />
</td>
<td>
<label for="option1">Option 1</label>
</td>
</tr>
<tr>
<td>
<input id="option2" name="myGroup" type="radio" />
</td>
<td>
<label for="option2">Option 2</label>
</td>
</tr>
....
</table>
</fieldset>

Related

Why am I getting so many br tags

I started writing html code and when I view it on chrome, the table is displayed after a long white space. When I inspect the element, on chrome, I get a lot of br tags but I have not given any br tags in the code
How come?
<!DOCTYPE html>
<head>
<title> Practice </title>
</head>
<body>
<table border="0.00001" align="center" bgcolor="silver">
<caption align="center"> <big><big><b> Registration Form </b><big><big> </caption><br><br>
<form name="My Form" action="" method="">
<tr>
<td> Username </td>
<td> <input type="text" name="t1" size="6"/> </td>
</tr><br><br>
<tr>
<td> Password </td>
<td> <input type="password" name="t2" size="6"/> </td>
</tr><br><br>
<tr>
<td> Name </td>
<td> <input type="text" name="t3" size="30"/> </td>
</tr><br><br>
<tr>
<td> Address </td>
<td> <input type="text" name="t4" size="30"/> </td>
</tr><br><br>
<tr>
<td> Country </td>
<td><select name="s1">
<option> Select Your Country </option>
<option> Afghanistan </option>
<option> Bangladesh </option>
<option> China </option>
<option> India </option>
<option> Russia </option>
</select></td>
</tr><br><br>
<tr>
<td> Zip Code </td>
<td> <input type="text" name="t5" size="6"/> </td>
</tr><br><br>
<tr>
<td> Email </td>
<td> <input type="text" name="t6" size="30"/> </td>
</tr><br><br>
<tr>
<td>Sex</td>
<td><input type="radio" name="r1" value="100" checked/>Male
<input type="radio" name="r1" value="102"/>Female</td>
</tr><br><br>
<tr>
<td>Language</td>
<td><input type="checkbox" name="r1" value="100" checked/>English
<input type="checkbox" name="r2" value="102"/>Non English</td>
</tr><br><br>
<tr>
<td> About </td>
<td><textarea name="a1" rows="5" cols="32"> </textarea></td>
</tr><br><br>
<tr align="centre">
<td><input type="submit" name="b2" value="submit here"/></td>
</tr><br><br>
</form>
</table>
I don't think this is <br>. Use Inspect Element to check what's causing so much gap before table. There might be some kind of margin before table.
You have a lot of unnecessary "br" tags in your code, inside your table. Remove them all and all will be fine! Cheers.
Use this code, This might solve your issues
<table border="0.00001" align="center" bgcolor="silver" cellpadding="10">
<caption align="center"><b> Registration Form </b> </caption><br><br>
<form name="My Form" action="" method="">
<tr>
<td> Username </td>
<td> <input type="text" name="t1" size="6"/> </td>
</tr>
<tr>
<td> Password </td>
<td> <input type="password" name="t2" size="6"/> </td>
</tr>
<tr>
<td> Name </td>
<td> <input type="text" name="t3" size="30"/> </td>
</tr>
<tr>
<td> Address </td>
<td> <input type="text" name="t4" size="30"/> </td>
</tr>
<tr>
<td> Country </td>
<td><select name="s1">
<option> Select Your Country </option>
<option> Afghanistan </option>
<option> Bangladesh </option>
<option> China </option>
<option> India </option>
<option> Russia </option>
</select></td>
</tr>
<tr>
<td> Zip Code </td>
<td> <input type="text" name="t5" size="6"/> </td>
</tr>
<tr>
<td> Email </td>
<td> <input type="text" name="t6" size="30"/> </td>
</tr>
<tr>
<td>Sex</td>
<td><input type="radio" name="r1" value="100" checked/>Male
<input type="radio" name="r1" value="102"/>Female</td>
</tr>
<tr>
<td>Language</td>
<td><input type="checkbox" name="r1" value="100" checked/>English
<input type="checkbox" name="r2" value="102"/>Non English</td>
</tr>
<tr>
<td> About </td>
<td><textarea name="a1" rows="5" cols="32"> </textarea></td>
</tr>
<tr align="centre">
<td><input type="submit" name="b2" value="submit here"/></td>
</tr>
</form>
</table>
Just removed some un-necessary tags, that might be causing issues. Please try
You had a lot of LF in your page. You need to check your editor
Also you had invalid tags and missed CSS
Here is a fixed version that validates
<!DOCTYPE html>
<html>
<head>
<title> Practice </title>
<style>
table {
border: 0.00001px;
background-color: silver;
margin: 0px auto;
}
caption {
text-align: center;
font-size: x-large;
}
.center {
text-align: center;
}
</style>
</head>
<body>
<form name="MyForm">
<table>
<caption>Registration Form</caption>
<tr>
<td>Username</td>
<td>
<input type="text" name="t1" size="6" /> </td>
</tr>
<tr>
<td>Password</td>
<td>
<input type="password" name="t2" size="6" /> </td>
</tr>
<tr>
<td>Name</td>
<td>
<input type="text" name="t3" size="30" /> </td>
</tr>
<tr>
<td>Address</td>
<td>
<input type="text" name="t4" size="30" /> </td>
</tr>
<tr>
<td>Country</td>
<td>
<select name="s1">
<option> Select Your Country </option>
<option> Afghanistan </option>
<option> Bangladesh </option>
<option> China </option>
<option> India </option>
<option> Russia </option>
</select>
</td>
</tr>
<tr>
<td>Zip Code</td>
<td>
<input type="text" name="t5" size="6" /> </td>
</tr>
<tr>
<td>Email</td>
<td>
<input type="text" name="t6" size="30" /> </td>
</tr>
<tr>
<td>Gender</td>
<td>
<input type="radio" name="r1" value="100" checked/>Male
<input type="radio" name="r1" value="102" />Female</td>
<input type="radio" name="r1" value="103" />Irrelevant</td>
</tr>
<tr>
<td>Language</td>
<td>
<input type="checkbox" name="r1" value="100" checked/>English
<input type="checkbox" name="r2" value="102" />Non English</td>
</tr>
<tr>
<td>About</td>
<td>
<textarea name="a1" rows="5" cols="32"> </textarea>
</td>
</tr>
<tr>
<td class="center" colspan="2">
<input type="submit" name="b2" value="submit here" />
</td>
</tr>
</table>
</form>
</body>
</html>

How to convert HTML table to List using Thymeleaf

I am creating an spring-boot MVC web application.
When I get the contents from the controller I can display them correctly on the view. The content is an object with a List. The list is displayed on a table.
<form th:action="#{/}" th:object="${homeVO}" method="post">
<div align="center">
<table width="80%" id="sectionsTable">
<thead>
<th width="10%"><label class="tableTextTitle">ORDER</label></th>
<th width="50%"><label class="tableTextTitle">TITLE</label></th>
<th width="10%"></th>
<th width="10%"><label class="tableTextTitle">HIDE</label></th>
<th width="10%"></th>
<th width="10%"></th>
</thead>
<tbody>
<tr th:each="section, stat :${homeVO.sections}">
<td>
<input type="number" th:value="${section.id}" hidden="true" id="sectionid" />
<input type="number" class="form-control" th:value="${section.position}" id="position"/>
</td>
<td>
<input type="text" class="form-control" th:value="${section.name}" disabled="true" id="name"/>
</td>
<td align="center">
<a th:href="#{./sectionprofile(id=${section.id})}" class="btn btn-default">EDIT</a>
</td>
<td>
<input type="text" class="form-control" th:value="${section.column}" id="column"/>
</td>
<td>
<select class="form-control" id="condition">
<option value="0" th:selected="(${section.condition} == 0)"/>
<option value="1" th:text="#{minor}" th:selected="(${section.condition} == 1)"/>
<option value="2" th:text='#{minorEq}' th:selected="(${section.condition} == 2)"/>
<option value="3" th:text="#{different}" th:selected="(${section.condition} == 3)"/>
<option value="4" th:text='#{equals}' th:selected="(${section.condition} == 4)"/>
<option value="5" th:text='#{biggerEq}' th:selected="(${section.condition} == 5)"/>
<option value="6" th:text='#{bigger}' th:selected="(${section.condition} == 6)"/>
</select>
</td>
<td>
<input type="text" class="form-control" th:value="${section.criteria}" id="criteria"/>
</td>
</tr>
</tbody>
</table>
</div>
<div class="col-md-12">
Add Section
<input type="submit" class="btn btn-default" value="SAVE" />
</div>
</form>
When I change some values on the table I want to save them. When I save, I get in the controller the object with an empty List.
#RequestMapping(method = RequestMethod.POST)
public String set(HomeVO homeVO, Model model) {
if (homeVO != null) {
for (SectionVO sectionVO : homeVO.getSections()) {
Section section = sectionRepository.findOne(sectionVO.getId());
section.setPosition(sectionVO.getPosition());
section.setColumn(sectionVO.getColumn());
section.setCondition(sectionVO.getCondition());
section.setCriteria(sectionVO.getCriteria());
sectionRepository.save(section);
}
}
...
return "home";
}
What shall I do to get the table elements back into a List?
To accomplish this rows bindings properly follow the Thymeleaf Spring guide specificaly Dynamic Fields section. There is a special syntax so your HTML should be similar to this:
<tr th:each="row,rowStat : *{rows}">
<td th:text="${rowStat.count}">1</td>
<td>
<select th:field="*{rows[__${rowStat.index}__].variety}">
<option th:each="var : ${allVarieties}"
th:value="${var.id}"
th:text="${var.name}">Thymus Thymi</option>
</select>
</td>
<td>
<input type="text" th:field="*{rows[__${rowStat.index}__].seedsPerCell}" />
</td>
<td>
<button type="submit" name="removeRow"
th:value="${rowStat.index}" th:text="#{seedstarter.row.remove}">Remove row</button>
</td>
</tr>

How to make the background color transparent

I'm using a webgrid to display the data and it displays the data in alternate and i have hard-coded the background color in one of the row and it works fine with one but not with the other, i'm not sure if this is the right approach to do.
my question is: how can I make it transparent to the background?
here is the pic:
here is the source code:
<tr class="webgrid-row-style">
<td><input readonly name="rowNumber_0" value="1" style="width:40px;border:0; background-color:#F5F5F5;" /></td>
<td><input type="text" id="Location" name="location_0" value="DATA CENTER" style="width:250px;" /></td>
<td><input type="text" id="RackShelf" name="rack_0" value="23" style="width:50px;"/></td>
<td><input type="text" id="DCLocation" name="dcLocation_0" value="71-" /></td>
<td><input type="text" id="Customer" name="customer_0" value="worth" style="width:250px;" /></td>
<td><input type="text" id="SerialNumber" name="serialNumber_0" value="5" /></td>
<td><input type="text" id="Location" name="location_0" value="DATA CENTER" /></td>
</tr>
<tr class="webgrid-alternating-row">
<td><input readonly name="rowNumber_1" value="2" style="width:40px;border:0; background-color:#F5F5F5;" /></td>
<td><input type="text" id="Location" name="location_1" value="DATA CENTER" style="width:250px;" /></td>
<td><input type="text" id="RackShelf" name="rack_1" value="9" style="width:50px;"/></td>
<td><input type="text" id="DCLocation" name="dcLocation_1" value="BD37:" /></td>
<td><input type="text" id="Customer" name="customer_1" value="Family Services" style="width:250px;" /></td>
<td><input type="text" id="SerialNumber" name="serialNumber_1" value="USE" /></td>
<td><input type="text" id="Location" name="location_1" value="DATA CENTER" /></td>
</tr>
//css
.webgrid-row-style {
padding: 3px 7px 2px;
background-color: #FFFFFF;
}
.webgrid-alternating-row {
background-color: #F5F5F5;
padding: 3px 7px 2px;
}
You can use:
background-color: transparent;
for both ,
.webgrid-row-style, .webgrid-alternating-row {
background-color: transparent
}
and since you're using an input in each td, add this style too
.webgrid-row-style td input, .webgrid-alternating-row td input{
background-color: transparent
}
background-color
If you just want the input to have the same background color as its parent (td) you could use background-color:inherit
.webgrid-row-style {
padding: 3px 7px 2px;
background-color: #FFFFFF;
}
.webgrid-alternating-row {
background-color: #F5F5F5;
padding: 3px 7px 2px;
}
<table border="0">
<tr class="webgrid-row-style">
<td><input readonly name="rowNumber_0" value="1" style="width:40px;border:0; background-color:inherit" /></td>
<td><input type="text" id="Location" name="location_0" value="DATA CENTER" style="width:250px;" /></td>
<td><input type="text" id="RackShelf" name="rack_0" value="23" style="width:50px;"/></td>
<td><input type="text" id="DCLocation" name="dcLocation_0" value="71-" /></td>
<td><input type="text" id="Customer" name="customer_0" value="worth" style="width:250px;" /></td>
<td><input type="text" id="SerialNumber" name="serialNumber_0" value="5" /></td>
<td><input type="text" id="Location" name="location_0" value="DATA CENTER" /></td>
</tr>
<tr class="webgrid-alternating-row">
<td><input readonly name="rowNumber_1" value="2" style="width:40px;border:0; background-color:inherit;" /></td>
<td><input type="text" id="Location" name="location_1" value="DATA CENTER" style="width:250px;" /></td>
<td><input type="text" id="RackShelf" name="rack_1" value="9" style="width:50px;"/></td>
<td><input type="text" id="DCLocation" name="dcLocation_1" value="BD37:" /></td>
<td><input type="text" id="Customer" name="customer_1" value="Family Services" style="width:250px;" /></td>
<td><input type="text" id="SerialNumber" name="serialNumber_1" value="USE" /></td>
<td><input type="text" id="Location" name="location_1" value="DATA CENTER" /></td>
</tr>
</table>
On a side note, avoid inline styles where possible.
This CSS should do it:
tr.webgrid-row-style td input {
background: transparent;
}
Note: if you're using Google Chrome (you probably should be) right click the element and click inspect element. Once Chrome's developer tools are open, right click the element and you can copy it's CSS path directly from there (when you aren't sure exactly how to target a DOM element with CSS).
You could always use background-color: rgba(c value,c value,c value,alpha value)
background-color: rgba(245,245,245,0.5);
As seen above using rgba allows you to specify an alpha colour.
remove css from your element
Demo
<tr class="webgrid-row-style">
<td>
<input readonly name="rowNumber_0" value="1" style="width:40px;border:0;" />
</td>
<td>
<input type="text" id="Location" name="location_0" value="DATA CENTER" style="width:250px;" />
</t <td>
<input type="text" id="RackShelf" name="rack_0" value="23" style="width:50px;" />
</td>
<td>
<input type="text" id="DCLocation" name="dcLocation_0" value="71-" />
</td>
<td>
<input type="text" id="Customer" name="customer_0" value="worth" style="width:250px;" />
</td>
<td>
<input type="text" id="SerialNumber" name="serialNumber_0" value="5" />
</td>
<td>
<input type="text" id="Location" name="location_0" value="DATA CENTER" />
</td>
</tr>
<tr class="webgrid-alternating-row">
<td>
<input readonly name="rowNumber_1" value="2" style="width:40px;border:0;" />
</td>
<td>
<input type="text" id="Location" name="location_1" value="DATA CENTER" style="width:250px;" />
</td>
<td>
<input type="text" id="RackShelf" name="rack_1" value="9" style="width:50px;" />
</td>
<td>
<input type="text" id="DCLocation" name="dcLocation_1" value="BD37:" />
</td>
<td>
<input type="text" id="Customer" name="customer_1" value="Family Services" style="width:250px;" />
</td>
<td>
<input type="text" id="SerialNumber" name="serialNumber_1" value="USE" />
</td>
<td>
<input type="text" id="Location" name="location_1" value="DATA CENTER" />
</td>
</tr>
css
.webgrid-row-style input:not([type]) {
padding: 3px 7px 2px;
background-color: transparent;
}
.webgrid-alternating-row input:not([type]) {
background-color: #F5F5F5;
padding: 3px 7px 2px;
}

How to get html controls form html table in server side,asp.net

Can any body tell me how can i get html controls form html table in server side in asp.net?
My code goes like this.
<div>
<table runat='server' id="CheckBoxList1">
<tr>
<td>
<input runat='server' id='CheckBoxList1_1' type='checkbox' name='CheckBoxList1$1'
value='1' /><label for='CheckBoxList1_1'>1</label>
</td>
<td>
<input runat='server' id='CheckBoxList1_22' type='checkbox' name='CheckBoxList1$22'
value='1' /><label for='CheckBoxList1_22'>22</label>
</td>
<td>
<input runat='server' id='CheckBoxList1_43' type='checkbox' name='CheckBoxList1$43'
value='1' /><label for='CheckBoxList1_43'>43</label>
</td>
</tr>
<tr>
<td>
<input runat='server' id='CheckBoxList1_2' type='checkbox' name='CheckBoxList1$2'
value='1' /><label for='CheckBoxList1_2'>2</label>
</td>
<td>
<input runat='server' id='CheckBoxList1_23' type='checkbox' name='CheckBoxList1$23'
value='1' /><label for='CheckBoxList1_23'>23</label>
</td>
<td>
<input runat='server' id='CheckBoxList1_44' type='checkbox' name='CheckBoxList1$44'
value='1' /><label for='CheckBoxList1_44'>44</label>
</td>
</tr>
<tr>
<td>
<input runat='server' id='CheckBoxList1_3' type='checkbox' name='CheckBoxList1$3'
value='1' /><label for='CheckBoxList1_3'>3</label>
</td>
<td>
<input runat='server' id='CheckBoxList1_24' type='checkbox' name='CheckBoxList1$24'
value='1' /><label for='CheckBoxList1_24'>24</label>
</td>
<td>
<input runat='server' id='CheckBoxList1_45' type='checkbox' name='CheckBoxList1$45'
value='1' /><label for='CheckBoxList1_45'>45</label>
</td>
</tr>
<tr>
<td>
<input runat='server' id='CheckBoxList1_4' type='checkbox' name='CheckBoxList1$4'
value='1' /><label for='CheckBoxList1_4'>4</label>
</td>
<td>
<input runat='server' id='CheckBoxList1_25' type='checkbox' name='CheckBoxList1$25'
value='1' /><label for='CheckBoxList1_25'>25</label>
</td>
<td>
<input runat='server' id='CheckBoxList1_46' type='checkbox' name='CheckBoxList1$46'
value='1' /><label for='CheckBoxList1_46'>46</label>
</td>
</tr>
<tr>
<td>
<input runat='server' id='CheckBoxList1_5' type='checkbox' name='CheckBoxList1$5'
value='1' /><label for='CheckBoxList1_5'>5</label>
</td>
<td>
<input runat='server' id='CheckBoxList1_26' type='checkbox' name='CheckBoxList1$26'
value='1' /><label for='CheckBoxList1_26'>26</label>
</td>
<td>
<input runat='server' id='CheckBoxList1_47' type='checkbox' name='CheckBoxList1$47'
value='1' /><label for='CheckBoxList1_47'>47</label>
</td>
</tr>
<tr>
<td>
<input runat='server' id='CheckBoxList1_6' type='checkbox' name='CheckBoxList1$6'
value='1' /><label for='CheckBoxList1_6'>6</label>
</td>
<td>
<input runat='server' id='CheckBoxList1_27' type='checkbox' name='CheckBoxList1$27'
value='1' /><label for='CheckBoxList1_27'>27</label>
</td>
<td>
<input runat='server' id='CheckBoxList1_48' type='checkbox' name='CheckBoxList1$48'
value='1' /><label for='CheckBoxList1_48'>48</label>
</td>
</tr>
<tr>
<td>
<input runat='server' id='CheckBoxList1_7' type='checkbox' name='CheckBoxList1$7'
value='1' /><label for='CheckBoxList1_7'>7</label>
</td>
<td>
<input runat='server' id='CheckBoxList1_28' type='checkbox' name='CheckBoxList1$28'
value='1' /><label for='CheckBoxList1_28'>28</label>
</td>
<td>
<input runat='server' id='CheckBoxList1_49' type='checkbox' name='CheckBoxList1$49'
value='1' /><label for='CheckBoxList1_49'>49</label>
</td>
</tr>
<tr>
<td>
<input runat='server' id='CheckBoxList1_8' type='checkbox' name='CheckBoxList1$8'
value='1' /><label for='CheckBoxList1_8'>8</label>
</td>
<td>
<input runat='server' id='CheckBoxList1_29' type='checkbox' name='CheckBoxList1$29'
value='1' /><label for='CheckBoxList1_29'>29</label>
</td>
<td>
<input runat='server' id='CheckBoxList1_50' type='checkbox' name='CheckBoxList1$50'
value='1' /><label for='CheckBoxList1_50'>50</label>
</td>
</tr>
<tr>
<td>
<input runat='server' id='CheckBoxList1_9' type='checkbox' name='CheckBoxList1$9'
value='1' /><label for='CheckBoxList1_9'>9</label>
</td>
<td>
<input runat='server' id='CheckBoxList1_30' type='checkbox' name='CheckBoxList1$30'
value='1' /><label for='CheckBoxList1_30'>30</label>
</td>
<td>
<input runat='server' id='CheckBoxList1_51' type='checkbox' name='CheckBoxList1$51'
value='1' /><label for='CheckBoxList1_51'>51</label>
</td>
</tr>
<tr>
<td>
<input runat='server' id='CheckBoxList1_10' type='checkbox' name='CheckBoxList1$10'
value='1' /><label for='CheckBoxList1_10'>10</label>
</td>
<td>
<input runat='server' id='CheckBoxList1_31' type='checkbox' name='CheckBoxList1$31'
value='1' /><label for='CheckBoxList1_31'>31</label>
</td>
<td>
<input runat='server' id='CheckBoxList1_52' type='checkbox' name='CheckBoxList1$52'
value='1' /><label for='CheckBoxList1_52'>52</label>
</td>
</tr>
<tr>
<td>
<input runat='server' id='CheckBoxList1_11' type='checkbox' name='CheckBoxList1$11'
value='1' /><label for='CheckBoxList1_11'>11</label>
</td>
<td>
<input runat='server' id='CheckBoxList1_32' type='checkbox' name='CheckBoxList1$32'
value='1' /><label for='CheckBoxList1_32'>32</label>
</td>
<td>
<input runat='server' id='CheckBoxList1_53' type='checkbox' name='CheckBoxList1$53'
value='1' /><label for='CheckBoxList1_53'>53</label>
</td>
</tr>
<tr>
<td>
<input runat='server' id='CheckBoxList1_12' type='checkbox' name='CheckBoxList1$12'
value='1' /><label for='CheckBoxList1_12'>12</label>
</td>
<td>
<input runat='server' id='CheckBoxList1_33' type='checkbox' name='CheckBoxList1$33'
value='1' /><label for='CheckBoxList1_33'>33</label>
</td>
<td>
<input runat='server' id='CheckBoxList1_54' type='checkbox' name='CheckBoxList1$54'
value='1' /><label for='CheckBoxList1_54'>54</label>
</td>
</tr>
<tr>
<td>
<input runat='server' id='CheckBoxList1_13' type='checkbox' name='CheckBoxList1$13'
value='1' /><label for='CheckBoxList1_13'>13</label>
</td>
<td>
<input runat='server' id='CheckBoxList1_34' type='checkbox' name='CheckBoxList1$34'
value='1' /><label for='CheckBoxList1_34'>34</label>
</td>
<td>
<input runat='server' id='CheckBoxList1_55' type='checkbox' name='CheckBoxList1$55'
value='1' /><label for='CheckBoxList1_55'>55</label>
</td>
</tr>
<tr>
<td>
<input runat='server' id='CheckBoxList1_14' type='checkbox' name='CheckBoxList1$14'
value='1' /><label for='CheckBoxList1_14'>14</label>
</td>
<td>
<input runat='server' id='CheckBoxList1_35' type='checkbox' name='CheckBoxList1$35'
value='1' /><label for='CheckBoxList1_35'>35</label>
</td>
<td>
<input runat='server' id='CheckBoxList1_56' type='checkbox' name='CheckBoxList1$56'
value='1' /><label for='CheckBoxList1_56'>56</label>
</td>
</tr>
<tr>
<td>
<input runat='server' id='CheckBoxList1_15' type='checkbox' name='CheckBoxList1$15'
value='1' /><label for='CheckBoxList1_15'>15</label>
</td>
<td>
<input runat='server' id='CheckBoxList1_36' type='checkbox' name='CheckBoxList1$36'
value='1' /><label for='CheckBoxList1_36'>36</label>
</td>
<td>
<input runat='server' id='CheckBoxList1_57' type='checkbox' name='CheckBoxList1$57'
value='1' /><label for='CheckBoxList1_57'>57</label>
</td>
</tr>
<tr>
<td>
<input runat='server' id='CheckBoxList1_16' type='checkbox' name='CheckBoxList1$16'
value='1' /><label for='CheckBoxList1_16'>16</label>
</td>
<td>
<input runat='server' id='CheckBoxList1_37' type='checkbox' name='CheckBoxList1$37'
value='1' /><label for='CheckBoxList1_37'>37</label>
</td>
<td>
<input runat='server' id='CheckBoxList1_58' type='checkbox' name='CheckBoxList1$58'
value='1' /><label for='CheckBoxList1_58'>58</label>
</td>
</tr>
<tr>
<td>
<input runat='server' id='CheckBoxList1_17' type='checkbox' name='CheckBoxList1$17'
value='1' /><label for='CheckBoxList1_17'>17</label>
</td>
<td>
<input runat='server' id='CheckBoxList1_38' type='checkbox' name='CheckBoxList1$38'
value='1' /><label for='CheckBoxList1_38'>38</label>
</td>
<td>
<input runat='server' id='CheckBoxList1_59' type='checkbox' name='CheckBoxList1$59'
value='1' /><label for='CheckBoxList1_59'>59</label>
</td>
</tr>
<tr>
<td>
<input runat='server' id='CheckBoxList1_18' type='checkbox' name='CheckBoxList1$18'
value='1' /><label for='CheckBoxList1_18'>18</label>
</td>
<td>
<input runat='server' id='CheckBoxList1_39' type='checkbox' name='CheckBoxList1$39'
value='1' /><label for='CheckBoxList1_39'>39</label>
</td>
<td>
<input runat='server' id='CheckBoxList1_60' type='checkbox' name='CheckBoxList1$60'
value='1' /><label for='CheckBoxList1_60'>60</label>
</td>
</tr>
<tr>
<td>
<input runat='server' id='CheckBoxList1_19' type='checkbox' name='CheckBoxList1$19'
value='1' /><label for='CheckBoxList1_19'>19</label>
</td>
<td>
<input runat='server' id='CheckBoxList1_40' type='checkbox' name='CheckBoxList1$40'
value='1' /><label for='CheckBoxList1_40'>40</label>
</td>
<td>
<input runat='server' id='CheckBoxList1_61' type='checkbox' name='CheckBoxList1$61'
value='1' /><label for='CheckBoxList1_61'>61</label>
</td>
</tr>
<tr>
<td>
<input runat='server' id='CheckBoxList1_20' type='checkbox' name='CheckBoxList1$20'
value='1' /><label for='CheckBoxList1_20'>20</label>
</td>
<td>
<input runat='server' id='CheckBoxList1_41' type='checkbox' name='CheckBoxList1$41'
value='1' /><label for='CheckBoxList1_41'>41</label>
</td>
<td>
</td>
</tr>
<tr>
<td>
<input runat='server' id='CheckBoxList1_21' type='checkbox' name='CheckBoxList1$21'
value='1' /><label for='CheckBoxList1_21'>21</label>
</td>
<td>
<input runat='server' id='CheckBoxList1_42' type='checkbox' name='CheckBoxList1$42'
value='1' /><label for='CheckBoxList1_42'>42</label>
</td>
<td>
</td>
</tr>
</table>
</div>
Thanks
Mohak
write the runat="Server" attribute in html control then you can use html control on server side.
ypur question is bit unclear, but I think this will help
for eg. to access the contorl with in a gridview we can use this, say if you place a hidden field inside gridview with the id of "hfone"
inside GvRowDataBound event
var field= (HiddenField)e.Row.FindControl("hfone");
so you can access the values by field.value

how can i get html controls form html table in server side in asp.net? [duplicate]

Can any body tell me how can i get html controls form html table in server side in asp.net?
My code goes like this.
<div>
<table runat='server' id="CheckBoxList1">
<tr>
<td>
<input runat='server' id='CheckBoxList1_1' type='checkbox' name='CheckBoxList1$1'
value='1' /><label for='CheckBoxList1_1'>1</label>
</td>
<td>
<input runat='server' id='CheckBoxList1_22' type='checkbox' name='CheckBoxList1$22'
value='1' /><label for='CheckBoxList1_22'>22</label>
</td>
<td>
<input runat='server' id='CheckBoxList1_43' type='checkbox' name='CheckBoxList1$43'
value='1' /><label for='CheckBoxList1_43'>43</label>
</td>
</tr>
<tr>
<td>
<input runat='server' id='CheckBoxList1_2' type='checkbox' name='CheckBoxList1$2'
value='1' /><label for='CheckBoxList1_2'>2</label>
</td>
<td>
<input runat='server' id='CheckBoxList1_23' type='checkbox' name='CheckBoxList1$23'
value='1' /><label for='CheckBoxList1_23'>23</label>
</td>
<td>
<input runat='server' id='CheckBoxList1_44' type='checkbox' name='CheckBoxList1$44'
value='1' /><label for='CheckBoxList1_44'>44</label>
</td>
</tr>
<tr>
<td>
<input runat='server' id='CheckBoxList1_3' type='checkbox' name='CheckBoxList1$3'
value='1' /><label for='CheckBoxList1_3'>3</label>
</td>
<td>
<input runat='server' id='CheckBoxList1_24' type='checkbox' name='CheckBoxList1$24'
value='1' /><label for='CheckBoxList1_24'>24</label>
</td>
<td>
<input runat='server' id='CheckBoxList1_45' type='checkbox' name='CheckBoxList1$45'
value='1' /><label for='CheckBoxList1_45'>45</label>
</td>
</tr>
<tr>
<td>
<input runat='server' id='CheckBoxList1_4' type='checkbox' name='CheckBoxList1$4'
value='1' /><label for='CheckBoxList1_4'>4</label>
</td>
<td>
<input runat='server' id='CheckBoxList1_25' type='checkbox' name='CheckBoxList1$25'
value='1' /><label for='CheckBoxList1_25'>25</label>
</td>
<td>
<input runat='server' id='CheckBoxList1_46' type='checkbox' name='CheckBoxList1$46'
value='1' /><label for='CheckBoxList1_46'>46</label>
</td>
</tr>
<tr>
<td>
<input runat='server' id='CheckBoxList1_5' type='checkbox' name='CheckBoxList1$5'
value='1' /><label for='CheckBoxList1_5'>5</label>
</td>
<td>
<input runat='server' id='CheckBoxList1_26' type='checkbox' name='CheckBoxList1$26'
value='1' /><label for='CheckBoxList1_26'>26</label>
</td>
<td>
<input runat='server' id='CheckBoxList1_47' type='checkbox' name='CheckBoxList1$47'
value='1' /><label for='CheckBoxList1_47'>47</label>
</td>
</tr>
<tr>
<td>
<input runat='server' id='CheckBoxList1_6' type='checkbox' name='CheckBoxList1$6'
value='1' /><label for='CheckBoxList1_6'>6</label>
</td>
<td>
<input runat='server' id='CheckBoxList1_27' type='checkbox' name='CheckBoxList1$27'
value='1' /><label for='CheckBoxList1_27'>27</label>
</td>
<td>
<input runat='server' id='CheckBoxList1_48' type='checkbox' name='CheckBoxList1$48'
value='1' /><label for='CheckBoxList1_48'>48</label>
</td>
</tr>
<tr>
<td>
<input runat='server' id='CheckBoxList1_7' type='checkbox' name='CheckBoxList1$7'
value='1' /><label for='CheckBoxList1_7'>7</label>
</td>
<td>
<input runat='server' id='CheckBoxList1_28' type='checkbox' name='CheckBoxList1$28'
value='1' /><label for='CheckBoxList1_28'>28</label>
</td>
<td>
<input runat='server' id='CheckBoxList1_49' type='checkbox' name='CheckBoxList1$49'
value='1' /><label for='CheckBoxList1_49'>49</label>
</td>
</tr>
<tr>
<td>
<input runat='server' id='CheckBoxList1_8' type='checkbox' name='CheckBoxList1$8'
value='1' /><label for='CheckBoxList1_8'>8</label>
</td>
<td>
<input runat='server' id='CheckBoxList1_29' type='checkbox' name='CheckBoxList1$29'
value='1' /><label for='CheckBoxList1_29'>29</label>
</td>
<td>
<input runat='server' id='CheckBoxList1_50' type='checkbox' name='CheckBoxList1$50'
value='1' /><label for='CheckBoxList1_50'>50</label>
</td>
</tr>
<tr>
<td>
<input runat='server' id='CheckBoxList1_9' type='checkbox' name='CheckBoxList1$9'
value='1' /><label for='CheckBoxList1_9'>9</label>
</td>
<td>
<input runat='server' id='CheckBoxList1_30' type='checkbox' name='CheckBoxList1$30'
value='1' /><label for='CheckBoxList1_30'>30</label>
</td>
<td>
<input runat='server' id='CheckBoxList1_51' type='checkbox' name='CheckBoxList1$51'
value='1' /><label for='CheckBoxList1_51'>51</label>
</td>
</tr>
<tr>
<td>
<input runat='server' id='CheckBoxList1_10' type='checkbox' name='CheckBoxList1$10'
value='1' /><label for='CheckBoxList1_10'>10</label>
</td>
<td>
<input runat='server' id='CheckBoxList1_31' type='checkbox' name='CheckBoxList1$31'
value='1' /><label for='CheckBoxList1_31'>31</label>
</td>
<td>
<input runat='server' id='CheckBoxList1_52' type='checkbox' name='CheckBoxList1$52'
value='1' /><label for='CheckBoxList1_52'>52</label>
</td>
</tr>
<tr>
<td>
<input runat='server' id='CheckBoxList1_11' type='checkbox' name='CheckBoxList1$11'
value='1' /><label for='CheckBoxList1_11'>11</label>
</td>
<td>
<input runat='server' id='CheckBoxList1_32' type='checkbox' name='CheckBoxList1$32'
value='1' /><label for='CheckBoxList1_32'>32</label>
</td>
<td>
<input runat='server' id='CheckBoxList1_53' type='checkbox' name='CheckBoxList1$53'
value='1' /><label for='CheckBoxList1_53'>53</label>
</td>
</tr>
<tr>
<td>
<input runat='server' id='CheckBoxList1_12' type='checkbox' name='CheckBoxList1$12'
value='1' /><label for='CheckBoxList1_12'>12</label>
</td>
<td>
<input runat='server' id='CheckBoxList1_33' type='checkbox' name='CheckBoxList1$33'
value='1' /><label for='CheckBoxList1_33'>33</label>
</td>
<td>
<input runat='server' id='CheckBoxList1_54' type='checkbox' name='CheckBoxList1$54'
value='1' /><label for='CheckBoxList1_54'>54</label>
</td>
</tr>
<tr>
<td>
<input runat='server' id='CheckBoxList1_13' type='checkbox' name='CheckBoxList1$13'
value='1' /><label for='CheckBoxList1_13'>13</label>
</td>
<td>
<input runat='server' id='CheckBoxList1_34' type='checkbox' name='CheckBoxList1$34'
value='1' /><label for='CheckBoxList1_34'>34</label>
</td>
<td>
<input runat='server' id='CheckBoxList1_55' type='checkbox' name='CheckBoxList1$55'
value='1' /><label for='CheckBoxList1_55'>55</label>
</td>
</tr>
<tr>
<td>
<input runat='server' id='CheckBoxList1_14' type='checkbox' name='CheckBoxList1$14'
value='1' /><label for='CheckBoxList1_14'>14</label>
</td>
<td>
<input runat='server' id='CheckBoxList1_35' type='checkbox' name='CheckBoxList1$35'
value='1' /><label for='CheckBoxList1_35'>35</label>
</td>
<td>
<input runat='server' id='CheckBoxList1_56' type='checkbox' name='CheckBoxList1$56'
value='1' /><label for='CheckBoxList1_56'>56</label>
</td>
</tr>
<tr>
<td>
<input runat='server' id='CheckBoxList1_15' type='checkbox' name='CheckBoxList1$15'
value='1' /><label for='CheckBoxList1_15'>15</label>
</td>
<td>
<input runat='server' id='CheckBoxList1_36' type='checkbox' name='CheckBoxList1$36'
value='1' /><label for='CheckBoxList1_36'>36</label>
</td>
<td>
<input runat='server' id='CheckBoxList1_57' type='checkbox' name='CheckBoxList1$57'
value='1' /><label for='CheckBoxList1_57'>57</label>
</td>
</tr>
<tr>
<td>
<input runat='server' id='CheckBoxList1_16' type='checkbox' name='CheckBoxList1$16'
value='1' /><label for='CheckBoxList1_16'>16</label>
</td>
<td>
<input runat='server' id='CheckBoxList1_37' type='checkbox' name='CheckBoxList1$37'
value='1' /><label for='CheckBoxList1_37'>37</label>
</td>
<td>
<input runat='server' id='CheckBoxList1_58' type='checkbox' name='CheckBoxList1$58'
value='1' /><label for='CheckBoxList1_58'>58</label>
</td>
</tr>
<tr>
<td>
<input runat='server' id='CheckBoxList1_17' type='checkbox' name='CheckBoxList1$17'
value='1' /><label for='CheckBoxList1_17'>17</label>
</td>
<td>
<input runat='server' id='CheckBoxList1_38' type='checkbox' name='CheckBoxList1$38'
value='1' /><label for='CheckBoxList1_38'>38</label>
</td>
<td>
<input runat='server' id='CheckBoxList1_59' type='checkbox' name='CheckBoxList1$59'
value='1' /><label for='CheckBoxList1_59'>59</label>
</td>
</tr>
<tr>
<td>
<input runat='server' id='CheckBoxList1_18' type='checkbox' name='CheckBoxList1$18'
value='1' /><label for='CheckBoxList1_18'>18</label>
</td>
<td>
<input runat='server' id='CheckBoxList1_39' type='checkbox' name='CheckBoxList1$39'
value='1' /><label for='CheckBoxList1_39'>39</label>
</td>
<td>
<input runat='server' id='CheckBoxList1_60' type='checkbox' name='CheckBoxList1$60'
value='1' /><label for='CheckBoxList1_60'>60</label>
</td>
</tr>
<tr>
<td>
<input runat='server' id='CheckBoxList1_19' type='checkbox' name='CheckBoxList1$19'
value='1' /><label for='CheckBoxList1_19'>19</label>
</td>
<td>
<input runat='server' id='CheckBoxList1_40' type='checkbox' name='CheckBoxList1$40'
value='1' /><label for='CheckBoxList1_40'>40</label>
</td>
<td>
<input runat='server' id='CheckBoxList1_61' type='checkbox' name='CheckBoxList1$61'
value='1' /><label for='CheckBoxList1_61'>61</label>
</td>
</tr>
<tr>
<td>
<input runat='server' id='CheckBoxList1_20' type='checkbox' name='CheckBoxList1$20'
value='1' /><label for='CheckBoxList1_20'>20</label>
</td>
<td>
<input runat='server' id='CheckBoxList1_41' type='checkbox' name='CheckBoxList1$41'
value='1' /><label for='CheckBoxList1_41'>41</label>
</td>
<td>
</td>
</tr>
<tr>
<td>
<input runat='server' id='CheckBoxList1_21' type='checkbox' name='CheckBoxList1$21'
value='1' /><label for='CheckBoxList1_21'>21</label>
</td>
<td>
<input runat='server' id='CheckBoxList1_42' type='checkbox' name='CheckBoxList1$42'
value='1' /><label for='CheckBoxList1_42'>42</label>
</td>
<td>
</td>
</tr>
</table>
</div>
Thanks
Mohak
write the runat="Server" attribute in html control then you can use html control on server side.
ypur question is bit unclear, but I think this will help
for eg. to access the contorl with in a gridview we can use this, say if you place a hidden field inside gridview with the id of "hfone"
inside GvRowDataBound event
var field= (HiddenField)e.Row.FindControl("hfone");
so you can access the values by field.value

Resources