I am adding form elements into a placeholder and as such asp.net appends info to the ID of the form control as shown below.
<input name="ctl00$ContentPlaceHolder1$txt_3" type="text" value="some text" id="ctl00_ContentPlaceHolder1_txt_3" />
so when I add my HTML label, it isn't going to work because its only got the ID that I assigned to the textbox and not the additional info that asp.net adds
<label for='txt_3'>my text box</label>
To illustrate this further, if I add a checkobox control asp.net renders the label automatically and gets it right
<input id="ctl00_ContentPlaceHolder1_chk_2" type="checkbox" name="ctl00$ContentPlaceHolder1$chk_2" checked="checked" />
<label for="ctl00_ContentPlaceHolder1_chk_2">Checkbox label</label>
I need the labels because accessibility is essential for the project in hand.
<input name="ctl00$ContentPlaceHolder1$txt_3" type="text" value="some text" id="ctl00_ContentPlaceHolder1_txt_3" />
so when I add my HTML label, it isn't going to work because its only got the ID that I assigned to the textbox and not the additional info that asp.net adds
<label for='txt_3'>my text box</label>
To illustrate this further, if I add a checkobox control asp.net renders the label automatically and gets it right
<input id="ctl00_ContentPlaceHolder1_chk_2" type="checkbox" name="ctl00$ContentPlaceHolder1$chk_2" checked="checked" />
<label for="ctl00_ContentPlaceHolder1_chk_2">Checkbox label</label>
I need the labels because accessibility is essential for the project in hand.