473,626 Members | 3,201 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

Jul 21 '05 #1
1 8743
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%40t kmsftngp02&rnum =1&prev=/groups%3Fq%3DRa dioButtonList%2 BRender
Contents%26hl%3 Dzh-CN%26lr%3D%26ie %3DUTF-8%26oe%3DUTF-8%26selm%3De6Bu ai0zBHA
.2272%2540tkmsf tngp02%26rnum%3 D1

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.s tamford.ct.us>
Sender: "Michael Albanese" <ma*******@ci.s tamford.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: AcN4bCY5hgM5qMy eQJi1tmTUcrbYzg ==
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
Newsgroups: microsoft.publi c.dotnet.genera l
Path: cpmsftngxa06.ph x.gbl
Xref: cpmsftngxa06.ph x.gbl microsoft.publi c.dotnet.genera l:108151
NNTP-Posting-Host: TK2MSFTNGXA08 10.40.1.160
X-Tomcat-NG: microsoft.publi c.dotnet.genera l

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="ShowM e('Enter your name.')"
runat="server" ></asp:TextBox>
</td>
</tr>
<tr>
<td>
<strong>Gender: </strong>
</td>
<td>
<asp:RadioButto nList id="rdGender"
onfocus="ShowM e('Enter your Gender.')" runat="server"
RepeatDirectio n="Horizontal ">
<asp:ListItem Value="Male"
onfocus="ShowM e('Enter your Gender.')">Male </asp:ListItem>
<asp:ListItem Value="Female"
onfocus="ShowM e('Enter your
Gender.')">Fem ale</asp:ListItem>
</asp:RadioButton List>
</td>
</tr>
<tr>
<td>
<strong>Favorit e Color:</strong>
</td>
<td>
<asp:DropDownLi st id="ddlColor"
onfocus="ShowM e('Pick a Color.')" runat="server">
<asp:ListItem
Value="Blue">B lue</asp:ListItem>
<asp:ListItem
Value="Green"> Green</asp:ListItem>
<asp:ListItem
Value="Red">Re d</asp:ListItem>
<asp:ListItem
Value="Plaid"> Plaid</asp:ListItem>
</asp:DropDownLis t>
</td>
</tr>
<tr>
<td id="showText" align="middle"
bgcolor="white smoke" colspan="2" height="50">
&nbsp;<stron g>- display
explanatory text here -</strong></td>
</tr>
<tr>
<td align="middle" colspan="2">
&nbsp;<asp:Butt on id="cmdSubmit"
runat="serve r" 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
2395
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> <HEAD> </HEAD> <BODY> <FORM>
1
2380
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 select three times to get the popup menu and everything seems slow. No errors are reported in the console however it seems as if the click event is not being processed after the focus event is processed.
4
11030
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 to: if one is clicked, its corresponding information will become available on another document, if it's not clicked no information will be provided. If multiple buttons are clicked their information will available on the same document. I'm not...
2
1452
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 one dropdown list and typical calendar. Clicking on the radio button did effectively modify the
3
3118
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, the text will change to lowercase. I added the following event, but still won't able to change the text to uppercase. Private Sub RadioButton1_CheckedChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles...
1
5548
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 this function: if (document.Form1.UserInfo_optStatus_2.checked) { .... }
5
3362
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 already. If it is selected, it doesn't fire. This isn't the case with a checkbox. The event fires whether the control is already checked or not. Thanks,
1
300
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 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
1
4076
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 hotspots on the image. One being correct(a) and the other incorrect(b). When the user clicks on the correct hotspot or place on the image, it should score and retain that value until the end of the quiz. At the end of the quiz, there is a submit button...
0
8265
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8637
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8364
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7193
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6125
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5574
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4092
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2625
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1511
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.