Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Dropdown box selections

Author  Topic 

froggy
Starting Member

14 Posts

Posted - 2006-11-02 : 03:08:03
Hi,

I am currently doing up a website and in it, I have a page which allow new records to be added. However, there is a portion which require user to key in the Department and Section. Instead of a textbox, a dropdown box is used. Due to many sections available, I would like to have the selections in the dropdown box to be based upon the selection made in the department.
Eg.
13 department: drop down box for it will be
SELECT DISTINCT dept FROM Info

Problem:
How do i then enable the Section dropdown box to have only those Sections belonging to a particular department?

Thank you.

chiragkhabaria
Master Smack Fu Yak Hacker

1907 Posts

Posted - 2006-11-02 : 03:19:00
On the Selchange event of the department, fill the combo of the section.

the query should be somthing like this

Select * From <YourTable> Where DeptCode = + MyCombo.Value



Chirag

http://chirikworld.blogspot.com/
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2006-11-02 : 03:49:17
We do this by dynamically changing the second SELECT list using javaScript (based on an Array of values that is stored in the page)

Kristen
Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2006-11-02 : 06:05:45
it depends if you want a postback or not.
Chirag's requires it
Kristen's doesnt.



Go with the flow & have fun! Else fight the flow
blog thingie: http://weblogs.sqlteam.com/mladenp
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2006-11-02 : 07:51:28
"it depends if you want a postback or not."

... and whether you are using .NET
Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2006-11-02 : 10:01:03
no not really...

a post back is just a fancy word



Go with the flow & have fun! Else fight the flow
blog thingie: http://weblogs.sqlteam.com/mladenp
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2006-11-02 : 12:02:05
Ah ... now had you have said "it depends if you want the performance-killer of a round-trip or not ..." I would have understood what you meant!
Go to Top of Page

froggy
Starting Member

14 Posts

Posted - 2006-11-02 : 20:08:09
Hi,

I am using ASP for this. I am still not getting it right, amd not sure what is wrong. Is there any examples available online which might be able to guide me along?
Go to Top of Page

froggy
Starting Member

14 Posts

Posted - 2006-11-02 : 20:08:09
Hi,

I am using ASP for this. I am still not getting it right, amd not sure what is wrong. Is there any examples available online which might be able to guide me along?
Go to Top of Page
   

- Advertisement -