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

How to call a javascript function on selected index changes in a RadioButtonList?

Hi,

I want to call a javascript function in attributes property of a RadioButtonList control when user changes his selection
Feb 28 '08 #1
2 3282
kenobewan
4,871 Expert 4TB
So you have an event and a method, where is the problem?
Feb 28 '08 #2
Frinavale
9,735 Expert Mod 8TB
Hi,

I want to call a javascript function in attributes property of a RadioButtonList control when user changes his selection
You're going to have to write the JavaScript function to handle the RadioButtonList Click event.

Then you'll have to apply the JavaScript to each RadioButton in the list so that it doesn't post back.

You can do this like:
Expand|Select|Wrap|Line Numbers
  1. For Each li As ListItem In MyRadioButtonList.Items
  2.     li.Attributes.Add("onclick","javascript:theJavaScriptFunctionName('"+li.Value+"');")
  3. Next
  4.  
In the above code I pass the value of the radio button to the JavaScript function so that the JavaScript function can do it's processing based on this value.


-Frinny
Feb 28 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Sue | last post by:
After finishing up my first quarter JavaScript on 12/12/03, I decided to improve character checking on my project. In my project I only had to do very basic validation. Therefore, I only had one...
3
by: Joe | last post by:
I have a function that changes an image when the user clicks a button (this works fine). There's another button that is used to transfer to another page an pass the selected image as a querystring....
5
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...
2
by: Alphonse Giambrone | last post by:
Hi all, I have two radiobuttonlist controls on a page. When a user checks 'No' for rblDeleted, I want to automatically set rblSendCard to 'No' and disable it. The javascript function I wrote to...
5
by: svein.erik.storkas | last post by:
How can i get the index of the button that is selected in a radiobuttonlist? I have a radiobuttonlist that contains 5 buttons, and i do a switch on what index that is selected, like this: ...
5
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...
8
by: chrisdude911 | last post by:
how do i add video into a javascript web page with my own custom buttons?
11
by: Faisal Vali | last post by:
Hi - I'm new to javascript and I was reading the book Javascript Professional Projects - there is a fragment that has me a little perplexed, and I was wondering if anyone could explain why and how...
2
by: Jeff | last post by:
I'm still new to all of this - mostly vb.net using vs 2005, so I might not be using good terminology but let me give my question a try: I'm looking for someone to point me in the correct...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.