client side

G

Guest

hey all,

i have a radiobuttonlist on my webform. i'd like to run some client-side
javascript that when you click it it puts the value of the option selected
into a textbox.

how do i do that?

thanks,
rodchar
 
R

rviray

add an onchange event on your radiobuttonlist control that runs
javascript

function chgInfo()
{
var txtInfo = document.getElementById('ID OF TEXTBOX');
var rbList = document.getElementById('ID OF RADIOBUTTONLIST');
//Now Loop
for (int =0; rbList.options.length, i++)
{
if(rbList.options.selected)
{
txtInfo.value = rbList.options.value; //check this questio
about TextBox object having a value property or text property...
}
}
 
G

Guest

function chgInfo()
{
var txtInfo = document.getElementById("TextBox1");
var rbList = document.getElementById("RadioButtonList1");
//Now Loop
for (i=0; rbList.options.length; i++)
{
if(rbList.options.selected)
{
txtInfo.value = rbList.options.value;
}
}
}


Error: 'options.length' is null or not an object is what i get. Any ideas?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,265
Latest member
TodLarocca

Latest Threads

Top