473,699 Members | 2,518 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

radio button & javascript attribute

Hi ....

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

<asp:radiobutto nlist id="one" runat="server" CssClass="text"
AutoPostBack="F alse" RepeatDirection ="Horizontal ">
<asp:ListItem Value="one">one </asp:ListItem>
<asp:ListItem Value="two">two </asp:ListItem>
<asp:ListItem Value="three">t hree</asp:ListItem>
<asp:ListItem Value="four">fo ur</asp:ListItem>
<asp:ListItem Value="five">fi ve</asp:ListItem>
</asp:radiobutton list>

<br>

<asp:Label id="Label1" runat="server" Visible=False>L abel</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.Attribu tes.Add("onclic k", "check()")

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

document.Form1. TextBox1.value = "test";
document.Form1. Label1.style.vi sibility = 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 2415
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*******@juan toselli.com> wrote in message
news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..
Hi ....

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

<asp:radiobutto nlist id="one" runat="server" CssClass="text"
AutoPostBack="F alse" RepeatDirection ="Horizontal ">
<asp:ListItem Value="one">one </asp:ListItem>
<asp:ListItem Value="two">two </asp:ListItem>
<asp:ListItem Value="three">t hree</asp:ListItem>
<asp:ListItem Value="four">fo ur</asp:ListItem>
<asp:ListItem Value="five">fi ve</asp:ListItem>
</asp:radiobutton list>

<br>

<asp:Label id="Label1" runat="server" Visible=False>L abel</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.Attribu tes.Add("onclic k", "check()")

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

document.Form1. TextBox1.value = "test";
document.Form1. Label1.style.vi sibility = 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
24435
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 via an onClick event) <script type="text/javascript"> function performPrePostChecks() { // myName being an iput text box
10
13453
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 related to checkboxes. Thanks!!!
3
2364
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) framenewinstall.CircuitNumber.checked=false; switch (transport) { case 0: Helpdesk.innerText="No Info Needed";
1
3419
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 ***********************, I've included all the code incase that isn't where the problem is. Any help would be hugely appreciated. Mick
3
2825
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" name="group1" value="3" label="Cheese" checked>Cheese<br>
11
4169
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 sets radio 2, when the user does something with field 2?
7
2527
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 browsers using the setAttribute() function. Everything works as planned in Firefox but in IE, the buttons won't populate and, what's worse, I can't even click on them after everything loads. I see the slight shadow that indicates you're clicking on a...
22
7961
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 am using getElelementsByName since these are radio buttons, but it seems that the dynamic element is not seen!!! This is my code... please let me know if there is anything that I am doing wrong! - thanks ---- ....
1
1697
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 problem after problem (object has no properties, undefined functions, etc.) So, I am really hoping someone can end the madness for me. Just so it's understood, the id's and names of the radio buttons vary with a row in a table so I CANT know the...
3
2752
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 One</A><BR> <INPUT TYPE=RADIO NAME=RAD VALUE=2 ID=RAD2> <LABEL FOR=RAD2>Check Two</LABEL><BR> <DIV STYLE="display:none"><INPUT TYPE=RADIO NAME=RAD ID=RAD3></DIV>
0
8685
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
9172
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
7745
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
6532
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
4374
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...
0
4626
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3054
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
2344
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2008
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.