Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Populate extra <tr><td> field when select DropDownList

Status
Not open for further replies.

GeeWond3r

IS-IT--Management
Sep 5, 2003
65
US
In Mixed-mode asp.net,

I've a Drop-down list in a table's <tr><td>ddl</td></tr>. If a user selects item x and only x, I want a textbox field to appear right below the drop-down list. And if some other item is selected, then that <tr><td>textbox</td></tr> that's right below the <tr><td>ddl</td></tr> should disappear.

Any suggestions?
 
Code:
<tr><td><asp:DropDownList id=myDDL runat=server DataTextField="myItems" DataValueField="myItemsID" AutoPostBack=True OnSelectedIndexChanged=checkMe /><br><asp:TextBox id=myTb runat=server width=150 Visible=False /></td></tr>
Code behind, or in script tag///
Code:
Sub CheckMe(sender As Object, e As EventArgs)
  If myDDL.SelectedItem.Text = "x" Then
     myTb.Visible = True
  Else
     myTb.Visible = False
  End If
End Sub

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top