If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > How to populate database vale in drop down with refreshing screen

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-13-02, 19:41
sharadgaikwad sharadgaikwad is offline
Registered User
 
Join Date: Sep 2002
Posts: 5
How to populate database vale in drop down with refreshing screen

Hi Guy's
I have a problem in populating database data in dropdowm box.

I had 4 drop down box and 4 table, based on first drop down selection second dropdown value should get populate,based on second 3'rd drop down should get populate and based on 3'rd dropdown selection 4'th drop down should get populate.

Condition,
No refresh of screen.I know it can be done using javascript but i am not getting any clear idea how to achieve it.I am using asp on server side and javascript on client side.

Thanks in advance.

Sharad
Reply With Quote
  #2 (permalink)  
Old 11-14-02, 12:20
Mulligan Mulligan is offline
Registered User
 
Join Date: Jul 2002
Posts: 55
You need to use DHTML (and your client browser needs to support it) and write out a LOT (probably) of client-side JavaScript to populate the second, third and fourth <select /> boxes.

The alternative, if you want to be REALLY fancy, is to use active scripting but then you're into a whole set of different issues.

This should get you started with dynamically adding items to a <select /> list.
Reply With Quote
  #3 (permalink)  
Old 12-03-02, 17:18
buzzter66 buzzter66 is offline
Registered User
 
Join Date: Nov 2002
Location: Houston, Texas
Posts: 85
DHTML is probably the answer...

I agree with the previous poster -- DHTML (CSS and Javascript) is probably the way to go.

In your first dropdown (SELECT tag), how many options are there? How many in the second dropdown?

In short, how many possible combinations are there? And, more importantly, how are these related? For instance, do you relate them using their index number, or does the value tell us the name of the next menu that will appear?

One approach might be to, when the page is first loaded. create each dropdown and put them inside a DIV tag with the display to none (ex. document.all.divName.style.display = "none"). Then, attach an onChange event handler to the first dropdown so that, when the user changes it, it pulls the name of the next dropdown out of its value property and triggers that dropdown to become visible.

The code itself is not really that hard... But the logic and planning might be VERY complicated, depending on how many different dropdown combinations are possible.

Good luck.
Reply With Quote
  #4 (permalink)  
Old 12-09-02, 13:10
mustangzrule mustangzrule is offline
Registered User
 
Join Date: Dec 2002
Posts: 1
In order to do this without postback, all data needs to be sent into your DHTML in some manner. With the .NET framework, the postbacks are relatively simple. If you are not limited by the connection speed, you should consider a postback.
Reply With Quote
  #5 (permalink)  
Old 12-10-02, 00:28
buzzter66 buzzter66 is offline
Registered User
 
Join Date: Nov 2002
Location: Houston, Texas
Posts: 85
Postback?

I'm not up to speed on .NET. What's a postback? Is it cool, and does it allow you to pull data back to the page without refreshing the page?
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On