Anyone worked out how to use the onFocus Attribute on the .Net RadioButton ?
In your code behind, if you do:
RB1.Attributes("onFocus" = "javascript:alert()"
the rendered html is:
<span onFocus="javascript:alert()" style="height:52px;width:132px;Z-INDEX: 101; LEFT: 367px; POSITION: absolute; TOP: 227px"><input id="RB1" type="radio" name="RB1" value="RB1" /></span>
..but the javascript does not run.
Note however that onClick does work...
RB1.Attributes("onClick" = "javascript:alert()"
gives..
<span onClick="javascript:alert()" style="height:52px;width:132px;Z-INDEX: 101; LEFT: 367px; POSITION: absolute; TOP: 227px"><input id="RB1" type="radio" name="RB1" value="RB1" /></span>
The javascript works fine. The only difference is that this is now an onClick and not an onFocus. If anyone can shed any light on this, or even tell me a way to use onClick that will work correctly when I tab into it (ie same functionality as onFocus), I would be really greatful.
Colin
In your code behind, if you do:
RB1.Attributes("onFocus" = "javascript:alert()"
the rendered html is:
<span onFocus="javascript:alert()" style="height:52px;width:132px;Z-INDEX: 101; LEFT: 367px; POSITION: absolute; TOP: 227px"><input id="RB1" type="radio" name="RB1" value="RB1" /></span>
..but the javascript does not run.
Note however that onClick does work...
RB1.Attributes("onClick" = "javascript:alert()"
gives..
<span onClick="javascript:alert()" style="height:52px;width:132px;Z-INDEX: 101; LEFT: 367px; POSITION: absolute; TOP: 227px"><input id="RB1" type="radio" name="RB1" value="RB1" /></span>
The javascript works fine. The only difference is that this is now an onClick and not an onFocus. If anyone can shed any light on this, or even tell me a way to use onClick that will work correctly when I tab into it (ie same functionality as onFocus), I would be really greatful.
Colin