Results 1 to 2 of 2

Thread: Radio buttons

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jan 2004
    Location
    fda
    Posts
    17

    Radio buttons

    I have 2 radio buttons in a form:

    <asp:RadioButton ID="radio1" Runat="server" GroupName="RadioGroup1" Text="Short Form" Checked="True" AutoPostBack="True" OnCheckedChanged="getSelected"></asp:RadioButton>
    <asp:RadioButton ID="radio2" Runat="server" GroupName="RadioGroup1" Text="Long Form" AutoPostBack="True" OnCheckedChanged="getSelected"></asp:RadioButton>


    public void getSelected(object sender,System.Eventags e)
    {
    // blah blah....
    }

    There are still a lot of texboxes and validation check in the form

    I have another textbox which needs to appear only when I select "Short Form". I did not know why it did not trigger getSelected at all. I paid attention to the left corner of the browser it said "Error on Page". I don't know how to bug this

    Thanks for figure out my problem.

  2. #2
    Frenzied Member
    Join Date
    May 2002
    Posts
    1,602
    in your selectedindexchanged event for the radiobuttonlist, use the code:

    VB Code:
    1. if mybuttons.selecteditem.text = "Short Form" then
    2.  
    3. textbox1.visible = true
    4.  
    5. end if

    it is the easiest way you can do it, I think....
    use a radiobuttonlist, not two radiobuttons...


    kind regards
    Henrik

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width