By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,686 Members | 2,339 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,686 IT Pros & Developers. It's quick & easy.

DropDown Box & text box problem

P: 9
Hi All,

depending upon text box entry i want to show drop down box with respective values.
means if user enters 'ls' in the text box i want to show the values like 'she','he' in dropdown box it appears in same page.

if text box entry other than 'ls' i want to show 'ladies', gents' in drop down box .

one more thing i want to hide this dopdown box until they have to give the value in text box..after deciding the value i want to show this dropdown list.

if any one help me..plz its urgent.........
Nov 22 '06 #1
Share this Question
Share on Google+
6 Replies


P: 9
Hi All,

depending upon text box entry i want to show drop down box with respective values.
means if user enters 'ls' in the text box i want to show the values like 'she','he' in dropdown box it appears in same page.

if text box entry other than 'ls' i want to show 'ladies', gents' in drop down box .

one more thing i want to hide this dopdown box until they have to give the value in text box..after deciding the value i want to show this dropdown list.

if any one help me..plz its urgent.........
Nov 22 '06 #2

sheenattt
P: 20
First of all make the textbox autopostback property true.On Text_change event make dropdowllist visible and also check its value like...this is not javascript code.

Expand|Select|Wrap|Line Numbers
  1. public void TextBox_TextChanged(object sender, EventArgs e)
  2. {
  3.  
  4. DropDownList.Visible=true;
  5. if(TextBox.Text=="ls")
  6. {
  7. DropDownList.Items.add("she");
  8. DropDownList.Items.add("he");
  9. }
  10. else
  11. {
  12. DropDownList.Items.add("ladies");
  13. DropDownList.Items.add("gents");
  14. }
  15. }
  16.  
Nov 23 '06 #3

P: 9
Hi Friend, Thx for reply

From where i can call this function and can u give one example how to write text box with that property..and what's that arguments u have passed to this function.

plz asap


First of all make the textbox autopostback property true.On Text_change event make dropdowllist visible and also check its value like...this is not javascript code.

Expand|Select|Wrap|Line Numbers
  1. public void TextBox_TextChanged(object sender, EventArgs e)
  2. {
  3.  
  4. DropDownList.Visible=true;
  5. if(TextBox.Text=="ls")
  6. {
  7. DropDownList.Items.add("she");
  8. DropDownList.Items.add("he");
  9. }
  10. else
  11. {
  12. DropDownList.Items.add("ladies");
  13. DropDownList.Items.add("gents");
  14. }
  15. }
  16.  
Nov 27 '06 #4

sheenattt
P: 20
In which language you r working in?This code is for .Net.By double clicking the Textbox you will get a default event where u can write this code.The functions are the inbuilt functions.You can try these.Bye


Expand|Select|Wrap|Line Numbers
  1. public void TextBox_TextChanged(object sender, EventArgs e)
  2. {
  3.  
  4. DropDownList.Visible=true;
  5. if(TextBox.Text=="ls")
  6. {
  7. DropDownList.Items.Clear();
  8. DropDownList.Items.add("she");
  9. DropDownList.Items.add("he");
  10. }
  11. else
  12. {
  13. DropDownList.Items.Clear();
  14. DropDownList.Items.add("ladies");
  15. DropDownList.Items.add("gents");
  16. }
  17. }
  18.  
Nov 27 '06 #5

sheenattt
P: 20
You can set the property of textbox like this.

Expand|Select|Wrap|Line Numbers
  1. void Page_Load()
  2. {
  3. TextBox.AutoPostBack=true;
  4. }
  5.  
  6.  
Nov 27 '06 #6

P: 9
Hi friend am working in java...

k anyway thx for ur help.

You can set the property of textbox like this.

Expand|Select|Wrap|Line Numbers
  1. void Page_Load()
  2. {
  3. TextBox.AutoPostBack=true;
  4. }
  5.  
  6.  
Nov 27 '06 #7

Post your reply

Sign in to post your reply or Sign up for a free account.