I am developing an application to handle my compay's OSHA
reporting requirements.
Some of the input criteria are technical and narowly
defined, so I was trying to prvide what i call "Context
Sensitive Help" by providing a short instructional message
based on which control has Focus.
Because of the way that a Radio Button List control is
rendered in the browser i can not attach an onFocus event
to the radion button input element the way i do to the
other controlls.
I could replace these with dropdown lists, but i would
rather not re-design the GUI as it has been stable for a
while now.
Below is a sample of the type of page i am working on and
a radio button list that will not play.
Any ideas would be greatly appreciated.
Michael Albanese
=============== =============== ==========
<%@ Page Language="VB" %>
<html>
<head>
<script language="javas cript">
function Setup(){
document.getEle mentById('txtNa me').focus();
}
function ShowMe(html){
showText.innerH TML = html
}
</script>
</head>
<body onload="Setup() ">
<form runat="server">
<table cellspacing="0" width="400" align="center"
border="1">
<tbody>
<tr>
<td>
<strong>Name: </strong>
</td>
<td>
<asp:TextBox id="txtName"
onfocus="ShowMe ('Enter your name.')"
runat="server"> </asp:TextBox>
</td>
</tr>
<tr>
<td>
<strong>Gender: </strong>
</td>
<td>
<asp:RadioButto nList id="rdGender"
onfocus="ShowMe ('Enter your Gender.')" runat="server"
RepeatDirection ="Horizontal ">
<asp:ListItem Value="Male"
onfocus="ShowMe ('Enter your Gender.')">Male </asp:ListItem>
<asp:ListItem Value="Female"
onfocus="ShowMe ('Enter your
Gender.')">Fema le</asp:ListItem>
</asp:RadioButton List>
</td>
</tr>
<tr>
<td>
<strong>Favorit e Color:</strong>
</td>
<td>
<asp:DropDownLi st id="ddlColor"
onfocus="ShowMe ('Pick a Color.')" runat="server">
<asp:ListItem
Value="Blue">Bl ue</asp:ListItem>
<asp:ListItem
Value="Green">G reen</asp:ListItem>
<asp:ListItem
Value="Red">Red </asp:ListItem>
<asp:ListItem
Value="Plaid">P laid</asp:ListItem>
</asp:DropDownLis t>
</td>
</tr>
<tr>
<td id="showText" align="middle"
bgcolor="whites moke" colspan="2" height="50">
<stron g>- display
explanatory text here -</strong></td>
</tr>
<tr>
<td align="middle" colspan="2">
<asp:Butt on id="cmdSubmit"
runat="server" Text="Submit"></asp:Button>
</td>
</tr>
</tbody>
</table>
<!-- Insert content here -->
</form>
</body>
</html>
reporting requirements.
Some of the input criteria are technical and narowly
defined, so I was trying to prvide what i call "Context
Sensitive Help" by providing a short instructional message
based on which control has Focus.
Because of the way that a Radio Button List control is
rendered in the browser i can not attach an onFocus event
to the radion button input element the way i do to the
other controlls.
I could replace these with dropdown lists, but i would
rather not re-design the GUI as it has been stable for a
while now.
Below is a sample of the type of page i am working on and
a radio button list that will not play.
Any ideas would be greatly appreciated.
Michael Albanese
=============== =============== ==========
<%@ Page Language="VB" %>
<html>
<head>
<script language="javas cript">
function Setup(){
document.getEle mentById('txtNa me').focus();
}
function ShowMe(html){
showText.innerH TML = html
}
</script>
</head>
<body onload="Setup() ">
<form runat="server">
<table cellspacing="0" width="400" align="center"
border="1">
<tbody>
<tr>
<td>
<strong>Name: </strong>
</td>
<td>
<asp:TextBox id="txtName"
onfocus="ShowMe ('Enter your name.')"
runat="server"> </asp:TextBox>
</td>
</tr>
<tr>
<td>
<strong>Gender: </strong>
</td>
<td>
<asp:RadioButto nList id="rdGender"
onfocus="ShowMe ('Enter your Gender.')" runat="server"
RepeatDirection ="Horizontal ">
<asp:ListItem Value="Male"
onfocus="ShowMe ('Enter your Gender.')">Male </asp:ListItem>
<asp:ListItem Value="Female"
onfocus="ShowMe ('Enter your
Gender.')">Fema le</asp:ListItem>
</asp:RadioButton List>
</td>
</tr>
<tr>
<td>
<strong>Favorit e Color:</strong>
</td>
<td>
<asp:DropDownLi st id="ddlColor"
onfocus="ShowMe ('Pick a Color.')" runat="server">
<asp:ListItem
Value="Blue">Bl ue</asp:ListItem>
<asp:ListItem
Value="Green">G reen</asp:ListItem>
<asp:ListItem
Value="Red">Red </asp:ListItem>
<asp:ListItem
Value="Plaid">P laid</asp:ListItem>
</asp:DropDownLis t>
</td>
</tr>
<tr>
<td id="showText" align="middle"
bgcolor="whites moke" colspan="2" height="50">
<stron g>- display
explanatory text here -</strong></td>
</tr>
<tr>
<td align="middle" colspan="2">
<asp:Butt on id="cmdSubmit"
runat="server" Text="Submit"></asp:Button>
</td>
</tr>
</tbody>
</table>
<!-- Insert content here -->
</form>
</body>
</html>
Comment