CheckBoxList with textbox for Other choice

Hi Gurus,

I have a list of choices with "Other" being the last choice of the list. For this choice, a user MUST enter a value into the textbox. How do I go about inserting a textbox control for only the "Other" choice?

Choice 1
Choice 2
Choice 3
Other Choice:  [ text box here ]

Thanks in advance!
Who is Participating?
qh0stConnect With a Mentor Author Commented:
I was able to solve this by using CSS and aligning it near the 'Other' selection.
Pratima PharandeCommented:
try this


<asp:CheckBox ID="CheckBox1" runat="server" />
        <asp:CheckBox ID="CheckBox2" runat="server" />
        <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>  
        <asp:Button ID="Button1" runat="server" Text="Button"  />

at codebehind add on page_load

 Button1.Attributes.Add("onclick", "return check()")


 <script language="javascript" type="text/javascript">
    function check()
     if ( document.getElementById("CheckBox2").checked == true)

       if(document.getElementById("TextBox1").value == "")
          alert("Please enter value");
          return false;
qh0stAuthor Commented:
Can this be done with a checkboxlist control?
The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

qh0stAuthor Commented:
Anyone there to help me? Please.
have a look at this accepted solution only difference is its done using radiobuttonlist
qh0stAuthor Commented:
This does not help me. I want to generate a textbox control in the same cell as the 'Other' checkbox selection.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.