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

asp.net radio buttons

hal
hello,
can someone point me to an example or show me how to grey out or hide a
text box when a certain radio button is selected? i've searched and
read through the internet for a couple of hours and couldn't find an
example of how to do this. Below is the code for my radio button and
text box. I can't figure out the c# code to put in the <script> tag.

<tr>
<td align="left">Progressive After One</td>
<td align="left">

<asp:RadioButton ID="ProgressiveYes" runat="server" Text="Yes"
GroupName="Progressive" />&nbsp;<br />
<asp:RadioButton ID="ProgressiveNo" runat="server" Text="No"
GroupName="Progressive" /></td>
</tr>

<tr>
<td align="left">No Time Penalty</td>
<td align="left"><asp:TextBox ID="NoTime" runat="server"
Width="40px"></asp:TextBox></td>
</tr>

Thanks

Feb 14 '06 #1
1 1629
Hi,

You have two options, if you do it in the server side you use
TextBox.Enabled = false; also you need to put in the radiobuttons's
autopostback = true;

if you want to do it client side, you need to know the clientID of the
textbox (it should be the same than the server side's id but that is not
always true) , :

document.all["NoTime"].disabled = true


--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"hal" <bo******@gmail.com> wrote in message
news:11**********************@g44g2000cwa.googlegr oups.com...
hello,
can someone point me to an example or show me how to grey out or hide a
text box when a certain radio button is selected? i've searched and
read through the internet for a couple of hours and couldn't find an
example of how to do this. Below is the code for my radio button and
text box. I can't figure out the c# code to put in the <script> tag.

<tr>
<td align="left">Progressive After One</td>
<td align="left">

<asp:RadioButton ID="ProgressiveYes" runat="server" Text="Yes"
GroupName="Progressive" />&nbsp;<br />
<asp:RadioButton ID="ProgressiveNo" runat="server" Text="No"
GroupName="Progressive" /></td>
</tr>

<tr>
<td align="left">No Time Penalty</td>
<td align="left"><asp:TextBox ID="NoTime" runat="server"
Width="40px"></asp:TextBox></td>
</tr>

Thanks

Feb 14 '06 #2

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

Similar topics

4
by: Oscar Monteiro | last post by:
I Have to sets of Radio buttons like so: <input type="radio" name=p1 value=1> <input type="radio" name=p1 value=2> <input type="radio" name=p1 value=3> <br> <input type="radio" name=p2 value=1>...
6
by: Craig Keightley | last post by:
I have a page that has n number of radio groups (yes/No) how can i prevent the form being submitted if more than one radio group is not selected? By default all radio groups are unchecked ...
2
by: James P. | last post by:
Help, I need to display radio buttons on a form. The data is from SQL table: each row in each table is displayed as a radio button. I have multiple SQL tables so I understand I need to put...
1
by: kenny8787 | last post by:
Hi, can anyone help here? I have the following code generated from a database, I want to have javascript calculate the costs of the selected items using radio buttons, subtotal the costs and...
2
by: dpazza | last post by:
Hi, I'm creating a quiz on using a form in VB 2005 express. I have four sets of questions and answers (labels and radio buttons) and I change between which set of questions is currently shown on...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...

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.