Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 23rd, 2004, 02:29 PM
Friend of Wrox
 
Join Date: Jul 2004
Posts: 240
Thanks: 0
Thanked 1 Time in 1 Post
Default Three dropdowns, one depended on another. Possible

I need your advice at first. I have the bible in a table database format. I have the "book_title" column which has 66 names of books, the "chapter" column, the "verse" column and the "text_data" column for the text.

What I was looking for is to build three dropdowns: 1 for the list of books, 1 for the list of chapters of a selected book and then 1 for the list of verses of the selected book and chapter. I was wondering if that can be done on one page or do I have to open an iframe to bring out the chapters of the selected book and then for the verse dropdown list?

 
Old December 24th, 2004, 02:28 AM
Friend of Wrox
 
Join Date: Sep 2004
Posts: 104
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to sureshbabu Send a message via Yahoo to sureshbabu
Default

Hi,
 that is poosible in one single page.To get the values to one dropdown depending on the selected value from other dropdown you need to submit to the same page.
Same thing you need to to for all other dropdowns.If you have queries mail me back


 
Old December 26th, 2004, 05:59 PM
Friend of Wrox
 
Join Date: Jul 2004
Posts: 240
Thanks: 0
Thanked 1 Time in 1 Post
Default

I found this which is a triple-linked list box. But by looking at the query statement it has many tables. All I need is for one table. I have one field for books, one for chapters, one for verses and one for text. How do I change it?

Code:
<%
' -----------------------------------------------
' this is a sample that shows how to call the
' "TripleLinkedList" function...
' -----------------------------------------------
Dim Conn
Dim sQuery
' -----------------------------------------------
' first open a connection....
'
' NOTE: to use this in your own site, 
'        simply change the conn.open call
'        to point to your own copy of the "pubs"
'        database...
' -----------------------------------------------
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open "pubs", "sa", ""
' -----------------------------------------------
' then set up a query
' -----------------------------------------------
sQuery = "SELECT p.pub_id, p.pub_name, t.title_id, t.title AS title_name, " & _
    "ta.au_id, a.au_fname + ' ' + a.au_lname AS au_name " & vbCrlf & _
    "FROM publishers p, titles t, titleauthor ta, authors a " & vbCrlf & _
    "WHERE p.pub_id=t.pub_id " & vbCrlf & _
    "  AND ta.title_id=t.title_id " & vbCrlf & _
    "  AND a.au_id = ta.au_id " & vbCrlf & _
    "ORDER BY pub_name, title, ta.au_ord "
' -----------------------------------------------
' the whole thing should be inside a <FORM> def
' -----------------------------------------------
%>
<FORM id=form1 name=form1>
<CENTER>
<%
' -----------------------------------------------
' the function will return a string containing
' the three listbox/combobox form elements
' that you can print or deal with however you want.
'
' see comments in the function definition
' for info on calling parameters...
' -----------------------------------------------
Response.Write TripleLinkedList(Conn, sQuery, "fieldname", 10, "pub_name", "title_name", "au_name", "au_id")
' -----------------------------------------------
' make sure you close and free your connection
' -----------------------------------------------
Conn.Close
Set Conn = Nothing
' -----------------------------------------------
' add anything else you want...
' -----------------------------------------------
%>
<P>
<INPUT TYPE=SUBMIT NAME="foo" VALUE="Buy This Car!">
</FORM>
</BODY>
</HTML>





Similar Threads
Thread Thread Starter Forum Replies Last Post
selection with two or more linked dropdowns swifty_programmer ASP.NET 2.0 Basics 3 July 26th, 2007 10:44 AM
Dynamic Dropdowns jasmine_vj Classic ASP Basics 2 April 17th, 2006 12:47 PM
Dropdowns in datagrid amithkiran ASP.NET 1.x and 2.0 Application Design 1 March 24th, 2005 05:33 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.