Skip to main content
September 19, 2012
Question

Dependent dynamic dropdown lists (ASP/VBScript)

  • September 19, 2012
  • 1 reply
  • 5960 views

DW3 - ASP, VBscript

My insert record form has two particular dynamic dropdown lists I'd like to create dependency for.  List two should propogate items based on list one.  The tables are related.  What is the most practical, easiest approach in doing this?

[Subject line edited by moderator to indicate server model]

This topic has been closed for replies.

1 reply

sudarshan.t
Inspiring
September 20, 2012

I'm not really an ASP Pro. But this link should help you:

http://examples.codecharge.com/CCSExamplePack2/DependentListBox/DependentListBox_desc.php

http://forums.asp.net/p/1101919/2275534.aspx

There's also an AJAX implementation that my team uses a lot which you can take a look at. Makes it very easy for you - http://www.asp.net/ajaxlibrary/AjaxControlToolkitSampleSite/CascadingDropDown/CascadingDropDown.aspx

Sorry please ignore the first link posted earlier. It's only if you buy CodeCharge studio. If you're ready to purchase, here's the link: http://www.codecharge.com/index2.php

Message was edited by: Sudarshan Thiagarajan

September 20, 2012

HI, thank you for your reply.

I'm using Classic ASP, so ASP.net code doesn't help.  I realize I'm looking at either onchange event(s) with function, or AJAX, but am having a very hard time finding good examples out there.  I haven't written functions from scratch yet and was hoping to find an example that I could use and manipulate.  My only concern using javascript is that very small percentage that has it disabled.  Although javascript seems to be the easiest way to go.

I've done the whole dropdown dependency thing to return records via submit onchange, but this is a bit different with an Insert Record behavior.  I certainly don't want it submitting prematurely, and I can't have the page refresh if other fields are filled out.

My dropdown options are dynamic, not static.  My two tables are simple and tied together via TypeID (PK/FK), so I basically need the first dropdown to tell the second dropdown to use the same TypeID (once picked) without submitting or refreshing. 

I have a feeling this is a fairly simple task, I just need a good example to get me started. Here are my tables:

tbl_types

typeID (pk)

type

tbl_items
itemID

item

typeID (fk)

If it's more appropriate for me to join a Classic ASP forum for this, I will and suggested sites are welcome.  I only use this forum because I'm using DW and ASP, and the title of the forum reads  "Dreamweaver Application Development: PHP/MySQL, ASP, Coldfusion."

Any help is appreciated.

November 17, 2012

Hi Chris,

Thank you for the tip. You are right! I had a quick look. It looks like a database based dynamic dependency drop down solution. Which probably is a better way of building up the dependency if you have a large set? I think I need a smaller set. I have a chice of 3 locations, each location has 2 - 3 rooms. User will first pick the location and then the appropriate option for that location will be presented for user to select. I want it hard - coded but not dynamic with a table of values.

I appreciate this tip. You are right price is reasonable!


Glad to help.