469,649 Members | 1,241 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,649 developers. It's quick & easy.

DropDown Box & text box problem

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
6 6093
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
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
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
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
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
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.

Similar topics

5 posts views Thread by michael | last post: by
reply views Thread by Philip Townsend | last post: by
1 post views Thread by GatorBait | last post: by
2 posts views Thread by Mike Collins | last post: by
4 posts views Thread by Greg Scharlemann | last post: by
1 post views Thread by William Youngman | last post: by
13 posts views Thread by Shutey | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.