Customize Option Group List

G

Guest

have an asp.net option group list.
I need to be able to style it or at least override the render event so i can
put in my own styles. Short of developing an inherited control of the option
group im not sure what else i can do.
I suppose the best way of explaining what i want to try and do is like this:

The option group list is rendered (when in flow layout) is rendered like this:
<span id="rbStatus">
<label for="rbStatus_0">Employed</label>
<input id="rbStatus_0" type="radio" name="rbStatus" value="1"
tabindex="1000" />
<br>
<label>

and so on and so forth. I need to change it so that it renders as:

<div id="rbStatus">
<div for="rbStatus_0">Employed</label>
<input id="rbStatus_0" type="radio" name="rbStatus" value="1"
tabindex="1000" />
<br>
<label>

or something to that effect. Does anyone have any idea how i can go about
this?
 
B

bruce barker

not sure what you are trying to do. it looks like you want to change the
span to a div. the only difference is the span is inline by default and
the div is block. you could change the span to a block element with css
(set the controls class), not need to make any changes to the control.

it looked like you might have wanted to change the label to a div. this
is bad idea. all input controls should have a <label> (not to be
confused with the asp:label, which is just a span). for check/radio
inputs, the label text is clickable. also when the using a page reader
(say for the blind) is used, it knows the label goes with the control.
see the Web Accessibility guidelines.


-- bruce (sqlwork.com)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top