Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Dynamically showing radio buttons

Reply
Thread Tools

Dynamically showing radio buttons

 
 
Gwenna Males via .NET 247
Guest
Posts: n/a
 
      05-21-2005
I'm have a site that shows text boxes dynamically depending on anumber that's entered in another text box - (i.e. if the personenters the number 2, they would get..)

age.textbox, tripcost.textbox, age.textbox, tripcost.textbox.
I'm trying to get a radio button to also appear dynamically (i.e.if the person enters the number 2, they would get..)

age.textbox, tripcost.textbox, member.radiobutton, age.textbox,tripcost.textbox member.radiobutton

The elements have all been named (radio buttons are member1through member10)

The script I have is working perfectly for the age and thetripcost but I'm not very good at scripts yet and the radiobutton script isn't working. (I know that it's just because Idon't know the correct format but I can't figure it out).. thescript I have is this:

{
dlResidence.Value =
pol.Pol.Residence;

dlDestination.Value =
pol.Pol.Destination;

rbCoverageSingle.Checked =
!pol.Pol.IsFamily;
rbCoverageFamily.Checked =
pol.Pol.IsFamily;

txtNumAdults.Value = pol.Insureds.Count.ToString();
hdnSelectedPlan.Value = pol.Pol.PlanCode;

for(int i=0;i<pol.Insureds.Count;i++)
{
TextBox txt = FindControl("txtAdultAge"+(i+1).ToString()) asTextBox;
txt.Visible = true;
txt.Text = pol.Insureds[i].Age.ToString();

txt = FindControl("txtTripCost"+(i+1).ToString()) as TextBox;
txt.Visible = true;
txt.Text = pol.Insureds[i].TripCost.ToString("n");

Radiobutton rb = e.Item.FindControl("rbMember"+(i+1)) asRadioButton;
rb.Visible = true;
rb.Text = pol.Insureds[i].Member.ToString();

}


};

--------------------------------
From: Gwenna Males

-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)

<Id>o9yjDLTsokuGCXsXPmSDWA==</Id>
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Created Radio Buttons displaying as if they were conventional buttons Dr. Leff Javascript 3 10-15-2007 09:47 PM
Created Radio Buttons displaying as if they were conventional buttons Dr. Leff Javascript 3 10-15-2007 05:18 AM
why radio buttons showing value sanmateof@gmail.com ASP .Net 0 11-14-2006 07:49 PM
ASP.NET Reset Radio Button in a group of Radio Buttons Scott D Johnson ASP .Net 1 09-27-2006 10:38 PM
ASP 1.1: DataGrid - Showing/Not Showing Buttons Ray Booysen ASP .Net 2 03-28-2006 02:49 PM



Advertisments