473,388 Members | 1,391 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,388 software developers and data experts.

radio button & javascript attribute

Hi ....

I have a radiobutton list and a label in a webform.

<asp:radiobuttonlist id="one" runat="server" CssClass="text"
AutoPostBack="False" RepeatDirection="Horizontal">
<asp:ListItem Value="one">one</asp:ListItem>
<asp:ListItem Value="two">two</asp:ListItem>
<asp:ListItem Value="three">three</asp:ListItem>
<asp:ListItem Value="four">four</asp:ListItem>
<asp:ListItem Value="five">five</asp:ListItem>
</asp:radiobuttonlist>

<br>

<asp:Label id="Label1" runat="server" Visible=False>Label</asp:Label>

I have set the AutoPostBack to False, as i want to be able to use the
keyboard to navigate thru' the RadioButtonList.

Once a particular radiobutton is selected, i want to be able to check with
RadioButton value selected and then display a hidden label.

On Page Load, i call the javascript function
ddPayer.Attributes.Add("onclick", "check()")

where
<script language="javascript">
function check(){

document.Form1.TextBox1.value = "test";
document.Form1.Label1.style.visibility = true; --- Drop an error here

}

</script>

I have been able to write a value to a textbox once any radiobutton has been
selected.

But i can't seem to trap the value of each of those radiobuttons, so i could
make it visible.

Any help is greatly appreciated.
--
Thank You,
Nov 18 '05 #1
1 2400
Your question is a bit convoluted - I am having a hard time following it.
However, the first thing I notice is that you set Visible=False on your
label. This tells the runtime not to display the label at all, which means
that it won't ever be rendered as HTML. As a result, a client side script
can't find it because it isn't truly there. You will need to handle your
visibility using a CSS class, rather than the visible attribute of the
control.

--
Chris Jackson
Software Engineer
Microsoft MVP - Windows Client
Windows XP Associate Expert
--
More people read the newsgroups than read my email.
Reply to the newsgroup for a faster response.
(Control-G using Outlook Express)
--

"Marcelo Oliveto" <we*******@juantoselli.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Hi ....

I have a radiobutton list and a label in a webform.

<asp:radiobuttonlist id="one" runat="server" CssClass="text"
AutoPostBack="False" RepeatDirection="Horizontal">
<asp:ListItem Value="one">one</asp:ListItem>
<asp:ListItem Value="two">two</asp:ListItem>
<asp:ListItem Value="three">three</asp:ListItem>
<asp:ListItem Value="four">four</asp:ListItem>
<asp:ListItem Value="five">five</asp:ListItem>
</asp:radiobuttonlist>

<br>

<asp:Label id="Label1" runat="server" Visible=False>Label</asp:Label>

I have set the AutoPostBack to False, as i want to be able to use the
keyboard to navigate thru' the RadioButtonList.

Once a particular radiobutton is selected, i want to be able to check with
RadioButton value selected and then display a hidden label.

On Page Load, i call the javascript function
ddPayer.Attributes.Add("onclick", "check()")

where
<script language="javascript">
function check(){

document.Form1.TextBox1.value = "test";
document.Form1.Label1.style.visibility = true; --- Drop an error here

}

</script>

I have been able to write a value to a textbox once any radiobutton has
been
selected.

But i can't seem to trap the value of each of those radiobuttons, so i
could
make it visible.

Any help is greatly appreciated.
--
Thank You,

Nov 18 '05 #2

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

Similar topics

4
by: Randell D. | last post by:
Folks, I have a form (called FORM1) - In my INPUT submit tag, I have an onClick event that I have successfully tested/used to display the value of a TEXT box using the following function (called...
10
by: DettCom | last post by:
Hello, I would like to be able to display or hide fields based on whether a specific Yes/No radio button is selected. This is in conjunction with a posting a just made here in the same group...
3
by: ewitkop90 | last post by:
Here is my code: <SCRIPT> function transportchange(transport) { if (framenewinstall.Helpdesk.checked) framenewinstall.Helpdesk.checked=false; if (framenewinstall.CircuitNumber.checked)...
1
by: MickG | last post by:
I am trying to change the value of the variable "hard" according to which radio button is pressed and I am having no joy. Could anyone help me with this, the problematic section is marked with...
3
by: lee | last post by:
Hello I need some javascript code I've written to handle 2 values from an HTML form. I've been successful using the "label" attribute (I've simplied the example below): <input type="radio"...
11
by: hygum | last post by:
I have combination of radio and select/input: http://sneleopard.dk/radio.html Is there a javascript which automatically sets radio 1, when the user does something with field 1, and automatically...
7
by: nathaniel.k.lee | last post by:
Is it not possible, in IE, to dynamically click a radio button? I'm grabbing some values from a database and using them to populate radio buttons on a page. I have alternate code for Firefox...
22
by: Saul | last post by:
I have a set of radio buttons that are created dynamically, after rendered I try loop thru this set by getting the length of the set, but I keep getting an error stating the element is undefined. I...
1
by: Sideswipe | last post by:
I am trying to concatenate selected values from numerous radio button sets into 1 series and assign it to a single hidden field. I have never done javascript before and I continue to run into...
3
by: Steve Swift | last post by:
I have a page containing: <FORM NAME=radios> <INPUT TYPE=RADIO NAME=RAD VALUE=1 ID=RAD1> <LABEL FOR=RAD1>Check One</LABEL> <A onClick="document.radios.RAD.checked=false; return false">Uncheck...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...
0
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...

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.