473,569 Members | 2,590 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

problem in calling javascript function in radiobuttonList


Hi All,

there is a radiobuttonlist having 2 list items (state & zipcode).
when i select state radiobutton the zipcode textbox should be disabled
and when i select a zipcode radiobutton the state textbox should be
disabled. And i need to handle this in client side only.
i'm not able to call a javascript function for radiobuttonlist .
can please some one help me to get out of this...

advance thanks
Mahi

--
novice_develope r
------------------------------------------------------------------------
Posted via http://www.codecomments.com
------------------------------------------------------------------------

Nov 19 '05 #1
1 3445
In the page_load event, have:

RadioButtonList .Items[0].Attributes.Add ("onclick", "document.f orms[0]." +
txtZip.ClientID + ".disabled=true ;" + txtState.Client ID +
".disabled=fals e;"); //Item 0 is State
RadioButtonList .Items[1].Attributes.Add ("onclick", "document.f orms[0]." +
txtZip.ClientID + ".disabled=fals e;" + txtState.Client ID +
".disabled=true ;"); // Item 1 is Zip

Hope this helps.

"novice_develop er" <no************ *********@mail. codecomments.co m> wrote in
message news:no******** *************@m ail.codecomment s.com...

Hi All,

there is a radiobuttonlist having 2 list items (state & zipcode).
when i select state radiobutton the zipcode textbox should be disabled
and when i select a zipcode radiobutton the state textbox should be
disabled. And i need to handle this in client side only.
i'm not able to call a javascript function for radiobuttonlist .
can please some one help me to get out of this...

advance thanks
Mahi

--
novice_develope r
------------------------------------------------------------------------
Posted via http://www.codecomments.com
------------------------------------------------------------------------
Nov 19 '05 #2

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

Similar topics

0
6421
by: Michelle Keys | last post by:
I am trying to call a print function to print a string from a database using javascript. Which is RC_DATA of Varchar2(2500). This is a javascript is not being used. I have a thing that needs to be modified: if(e.CommandName =="Print") { string parsedreceipt = null; parsedreceipt = DecodeReceipt (e.Item.Cells.Text); Session =...
2
8077
by: Sean | last post by:
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...
1
2414
by: Marcelo Oliveto | last post by:
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...
5
1915
by: Jon | last post by:
I would like to pass a reference of a webcontrol into a javascript function. Below I have a snippet of code. "me.selectedValue" returns undefined. I was hoping that would return the value that the user has selected in the radio list.. ps: this is my first post, be gentle:) **aspx page** <form id="Form1" method="post" runat="server">
0
2200
by: Ryan Taylor | last post by:
Hello. I am having another issue. I need to execute some JavaScript whenever a radio button is clicked. I am currently using a RadioButtonList control to generate the radio buttons because of its excellent ability to be bound to a datasource. No matter what I do though, I am not able to add an onclick event to the individual radio buttons...
4
2078
by: Bass Pro | last post by:
Hi, I am creating textbox, radiobuttonlist and checkboxlist dynamically depending on data from a table. It is a questionnaire. I add the control on a Panel control during the 1st load_page event. Each question is displayed and answered, then result written to a SQL table. Then the next question is read from a table and displayed using the...
5
6248
by: dighazuse | last post by:
trying to get a javascript attached to a DataGrid RadioButtonList. I have a similar thing working for a DDL so i copied that for the RBL. It "errors" when i am trying to get the current selected value for the RBL. code in ItemDataBound: rblDC.Attributes.Add("onClick", "rblDC_onClick('" + lblDC.ClientID + "', '" + rblDCodes.ClientID +...
2
2011
by: mark4asp | last post by:
When I view-source I see that ASP.NET 2 has given the control: lstActivities no id but a name="ctl00$ContentPlaceHolder$lstActivities" How can I get the client-side id (or name) of a HTML element? (the id that is seen by javascript). What should I put in between the server tags: CheckStyle('<% %>') such that the div id="tdStyle" is...
2
3293
by: ameetijantakar | last post by:
Hi, I want to call a javascript function in attributes property of a RadioButtonList control when user changes his selection
0
7701
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...
0
7924
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. ...
0
8130
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...
1
7677
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...
0
7979
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
3653
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...
0
3643
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1223
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
940
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...

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.