473,386 Members | 1,908 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

onFocus event for Radio button list controll

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>
<asp:DropDownList 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>
</asp:DropDownList>
</td>
</tr>
<tr>
<td id="showText" align="middle"
bgcolor="whitesmoke" colspan="2" height="50">
&nbsp;<strong>- display
explanatory text here -</strong></td>
</tr>
<tr>
<td align="middle" colspan="2">
&nbsp;<asp:Button id="cmdSubmit"
runat="server" Text="Submit"></asp:Button>
</td>
</tr>
</tbody>
</table>
<!-- Insert content here -->
</form>
</body>
</html>

Jul 21 '05 #1
1 8710
Hi Michael,

There is known issue in the Radio Button List control.
Take a look at
BUG: Attributes Property of ListItem Only Works Within an HtmlSelect Control
http://support.microsoft.com/default...;en-us;Q309338

and

http://groups.google.com/groups?hl=z...&threadm=e6Bua
i0zBHA.2272%40tkmsftngp02&rnum=1&prev=/groups%3Fq%3DRadioButtonList%2BRender
Contents%26hl%3Dzh-CN%26lr%3D%26ie%3DUTF-8%26oe%3DUTF-8%26selm%3De6Buai0zBHA
.2272%2540tkmsftngp02%26rnum%3D1

Did I answer your question?

Regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

--------------------
Content-Class: urn:content-classes:message
From: "Michael Albanese" <ma*******@ci.stamford.ct.us>
Sender: "Michael Albanese" <ma*******@ci.stamford.ct.us>
Subject: onFocus event for Radio button list controll
Date: Thu, 11 Sep 2003 06:53:58 -0700
Lines: 110
Message-ID: <05****************************@phx.gbl>
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
Thread-Index: AcN4bCY5hgM5qMyeQJi1tmTUcrbYzg==
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
Newsgroups: microsoft.public.dotnet.general
Path: cpmsftngxa06.phx.gbl
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.general:108151
NNTP-Posting-Host: TK2MSFTNGXA08 10.40.1.160
X-Tomcat-NG: microsoft.public.dotnet.general

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>
<asp:DropDownList 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>
</asp:DropDownList>
</td>
</tr>
<tr>
<td id="showText" align="middle"
bgcolor="whitesmoke" colspan="2" height="50">
&nbsp;<strong>- display
explanatory text here -</strong></td>
</tr>
<tr>
<td align="middle" colspan="2">
&nbsp;<asp:Button id="cmdSubmit"
runat="server" Text="Submit"></asp:Button>
</td>
</tr>
</tbody>
</table>
<!-- Insert content here -->
</form>
</body>
</html>


Jul 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Scott Navarre | last post by:
Hi, I have Red Hat 8.0 and have the default Mozilla browser that comes with it. I am programming in javascript and have come across something problematic. Given the following code: <HTML>...
1
by: Eric Trav | last post by:
Hello, I am using mozilla and javascript to change the style background color for my select with onfocus() and back to white with onblur(). When i process onfocus(); i have to click on the...
4
by: Jared | last post by:
Radio Button or Check Box and Event Procedures I need to insert either radio buttons or check boxes onto my form. I'm not sure which to use, or if there are other options. I am using the buttons...
2
by: Xela | last post by:
Hi all, I have radio button list in a user control which when selection changed fire an event which will modify the current Thread culture. This user control is on general page which contain...
3
by: John Davis | last post by:
I created a ASP.NET Web Form using VB.NET with a text box, 2 radio buttons. When the user click the first radio button, the text will change to uppercase. If the user clicks the other radio button,...
1
by: Leeor Geva | last post by:
did any of you guys notice when adding an onclick javascript to a Radio Button List, it will get fired BEFORE the Dot is set if you click on the Text for that particular Circle. My onlick calls...
5
by: tshad | last post by:
Is there a way to allow a user to press a radio button if it is already selected? There is an onCheckedChanged event that fires when the person presses the button and it is isn't selected...
1
by: Michael Albanese | last post by:
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...
1
by: sourcie | last post by:
I am changing an existing quiz found on "JavaScriptKit.com Multiple Choice Quiz" I have an image. Instead of using the radio buttons with the normal true/false question, I want to place two...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.