469,325 Members | 1,651 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

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

Show/hide and update combo box

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
10 6868
ssnaik84
149 100+
are you using AJAX or normal ASP.NET stuff?
Sep 22 '09 #2
Neither. Just js, html and php.
Sep 22 '09 #3
ssnaik84
149 100+
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
149 100+
ohh.. sorry... i thought you are a .NET developer..
Sep 22 '09 #5
ssnaik84
149 100+
use AJAX in such cases.. it will make your life simple.. :)
there are several good articles here like this
Sep 22 '09 #6
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
8,651 Expert Mod 8TB
@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
<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
8,651 Expert Mod 8TB
@truptivk
I would say so, you’d better use AJAX in this case.
Sep 23 '09 #10
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.

Similar topics

reply views Thread by Nathan Carroll | last post: by
1 post views Thread by Gian Paolo | last post: by
reply views Thread by Gian Paolo | last post: by
reply views Thread by Reinhard | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by Gurmeet2796 | last post: by
reply views Thread by mdpf | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.