M
Michael Albanese
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="javascript">
function Setup(){
document.getElementById('txtName').focus();
}
function ShowMe(html){
showText.innerHTML = 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:RadioButtonList 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.')">Female</asp:ListItem>
</asp:RadioButtonList>
</td>
</tr>
<tr>
<td>
<strong>Favorite Color:</strong>
</td>
<td>
<aspropDownList id="ddlColor"
onfocus="ShowMe('Pick a Color.')" runat="server">
<asp:ListItem
Value="Blue">Blue</asp:ListItem>
<asp:ListItem
Value="Green">Green</asp:ListItem>
<asp:ListItem
Value="Red">Red</asp:ListItem>
<asp:ListItem
Value="Plaid">Plaid</asp:ListItem>
</aspropDownList>
</td>
</tr>
<tr>
<td id="showText" align="middle"
bgcolor="whitesmoke" colspan="2" height="50">
<strong>- display
explanatory text here -</strong></td>
</tr>
<tr>
<td align="middle" colspan="2">
<asp:Button 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="javascript">
function Setup(){
document.getElementById('txtName').focus();
}
function ShowMe(html){
showText.innerHTML = 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:RadioButtonList 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.')">Female</asp:ListItem>
</asp:RadioButtonList>
</td>
</tr>
<tr>
<td>
<strong>Favorite Color:</strong>
</td>
<td>
<aspropDownList id="ddlColor"
onfocus="ShowMe('Pick a Color.')" runat="server">
<asp:ListItem
Value="Blue">Blue</asp:ListItem>
<asp:ListItem
Value="Green">Green</asp:ListItem>
<asp:ListItem
Value="Red">Red</asp:ListItem>
<asp:ListItem
Value="Plaid">Plaid</asp:ListItem>
</aspropDownList>
</td>
</tr>
<tr>
<td id="showText" align="middle"
bgcolor="whitesmoke" colspan="2" height="50">
<strong>- display
explanatory text here -</strong></td>
</tr>
<tr>
<td align="middle" colspan="2">
<asp:Button id="cmdSubmit"
runat="server" Text="Submit"></asp:Button>
</td>
</tr>
</tbody>
</table>
<!-- Insert content here -->
</form>
</body>
</html>