RadioButton Control

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,
How can I make RadioButtons to display all in the same row? It looks that
one Radio button per line by default.
Secondly, I was wondering if there is a way to fire up Javascript when a
Radio Button is selected. For example, depending on which Radio button gets
selected, I need to show/hide a text box. Is it something I need to use
Asp.Net AJAX (or easier way)?

Thanks....a
 
Hello,
How can I make RadioButtons to display all in the same row? It looks that
one Radio button per line by default.
Secondly, I was wondering if there is a way to fire up Javascript when a
Radio Button is selected. For example, depending on which Radio button gets
selected, I need to show/hide a text box. Is it something I need to use
Asp.Net AJAX (or easier way)?

Thanks....a

hi...

why dont you use Radio Button List... and change the "RepeatDirection"
to "Horizontal"...
but if you dont want to use radioButtonList... use css to control the
flow of the radiobuttons...
drop them in single div.. and set style to display:inline;.....

about the javascript part... if you are on radio buttonlist... loop
through them items and then add onclick attribute and then set a
javascript

foreach (ListItem item in RadioButtonList1.Items)
{
item.Attributes.Add("onClick",
"window.alert('yahoo');");
}
some thing like that...
in javascript fuction hide show the textbox... depending on the radio
checked or not...

Thanks
Md. Masudur Rahman (Munna)
Kaz Software Ltd.
www.kaz.com.bd
http://munnacs.110mb.com
 
Thanx Masudur,
I have not added an event to a control and I assume I do this as part of
page load or init?
 
Hi Ace
Secondly, I was wondering if there is a way to fire up Javascript when a
Radio Button is selected. For example, depending on which Radio button
gets
selected, I need to show/hide a text box. Is it something I need to use
Asp.Net AJAX (or easier way)?
The RadioButtonList provides a property named "AutoPostBack".
If the property set to true, a postback through javascript fired.
-
http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.listcontrol.autopostback.aspx
 
Back
Top