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

Show/hide and update combo box

P: 14
Hello all,

I have a situation and I'd appreciate it if any of you could help me. I am not sure if this is js or html but here goes. I have a main combo box (mcb) which I'm displaying some values.

Based on what the user chooses, 2 combo boxes should be displayed on same page. The first combo box (CB1), should be filled with some values. The second, (CB2) however, should get loaded on basis of what is chosen in CB1. UNtil then, CB2 should be empty (but visible). When user chooses a value in CB1, and then CB2, a 3rd combo box, CB3 should be displayed. CB3 will have values already, based on what is chosen in CB2. If use decides not to select any value from CB2, CB3 is not displayed at all.

Until now, this is what I have done.

1. I have the main combo box (mcb).
2. In Onchange event of mcb, CB1 and CB2 get displayed. CB1 has values, CB2 does not.
3. In OnChange of CB1, CB2 gets populated.

Thats all. Now I want a CB3 to be displayed with values in it, depending on if and what the user chooses in CB2.

Can anyone help? :)

Thanks!
Trupti
Sep 22 '09 #1
Share this Question
Share on Google+
10 Replies


ssnaik84
100+
P: 149
are you using AJAX or normal ASP.NET stuff?
Sep 22 '09 #2

P: 14
Neither. Just js, html and php.
Sep 22 '09 #3

ssnaik84
100+
P: 149
bind dataview to your CB3..
use DataView.RowFilter to filter it each time, when user change value of CB2..
and bind it to CB3 again..
Sep 22 '09 #4

ssnaik84
100+
P: 149
ohh.. sorry... i thought you are a .NET developer..
Sep 22 '09 #5

ssnaik84
100+
P: 149
use AJAX in such cases.. it will make your life simple.. :)
there are several good articles here like this
Sep 22 '09 #6

P: 14
I see... is there anyway to do it with js and html? I don't know Ajax and I'm guessing it'll take me time to understand it and write code for my scenario.
Sep 23 '09 #7

Dormilich
Expert Mod 5K+
P: 8,639
@truptivk
it would only be sensible, if the total content is not too much (because you have to supply all the data for the combo boxes along with the page load).
Sep 23 '09 #8

P: 14
<Dormilich>
it would only be sensible, if the total content is not too much (because you have to supply all the data for the combo boxes along with the page load).
</Dormilich>

Thank you. That is what I was thinking too, if I'm only going to use js and html AND want to be on same page.

In which case, it is about 4200 records. (Is that a lot?) If yes, then is Ajax my only hope? :(
Sep 23 '09 #9

Dormilich
Expert Mod 5K+
P: 8,639
@truptivk
I would say so, you’d better use AJAX in this case.
Sep 23 '09 #10

P: 14
Thank you, I will do that :) Thank you all for taking time out to respond to my query.
Sep 24 '09 #11

Post your reply

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