|
RobM_01 -> RE: Multiple Drop-Down list box (1/2/2004 5:27:55)
|
Hi Betheball, thank you very much for your reply. I have now created 3 asp pages, to which I have called s_cat s_subcat s_portfolio Using the code that you supplied, I assume that half went in s_cat and the rest in s_subcat. The first file s_cat produced the drop down list with the categories. After selecting a category it loaded the next page s_subcat with an empty dropdown. I'm not sure if I followed your instructions correctly. the following is the code for each file: s_cat <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <title>s_cat</title> </head> <body> <form method="POST" name="Form1" action="s_subcat.asp"> <p><nobr><!--#include file="_fpclass/fpdblib.inc"--> <% fp_sQry="SELECT DISTINCT Category FROM Image_records" fp_sDefault="" fp_sNoRecords="No records returned." fp_sDataConn="Database1" fp_iMaxRecords=256 fp_iCommandType=1 fp_iPageSize=0 fp_fTableFormat=False fp_fMenuFormat=True fp_sMenuChoice="Category" fp_sMenuValue="Category" fp_iDisplayCols=1 fp_fCustomQuery=False BOTID=0 fp_iRegion=BOTID %> <select NAME="Category" SIZE="1" ONCHANGE=Form1.submit()> <option selected><%=Request.Form("Category")%></option> <!--#include file="_fpclass/fpdbrgn1.inc"--> <option><%=FP_FieldHTML(fp_rs,"Category")%></option> <!--#include file="_fpclass/fpdbrgn2.inc"--> </select> </nobr></p> </form> </body> </html> _______________________________________________ s_subcat <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <title>s_subcat</title> </head> <body><form method="POST" name="Form2" action="s_portfolio.asp"> <p><nobr><!--#include file="_fpclass/fpdblib.inc"--> <% fp_sQry="SELECT DISTINCT Sub_Category FROM Image_records WHERE Category = '::Category::'" fp_sDefault="" fp_sNoRecords="No records returned." fp_sDataConn="Database1" fp_iMaxRecords=256 fp_iCommandType=1 fp_iPageSize=0 fp_fTableFormat=False fp_fMenuFormat=True fp_sMenuChoice="Sub_Category" fp_sMenuValue="Sub_Category" fp_iDisplayCols=1 fp_fCustomQuery=False BOTID=0 fp_iRegion=BOTID %> <% IF Request.Form("Category") = "" Then Else %> <select NAME="Sub_Category" SIZE="1" ONCHANGE=Form2.submit()> <option selected><%=Request.Form("Sub_Category")%></option> <!--#include file="_fpclass/fpdbrgn1.inc"--> <option><%=FP_FieldHTML(fp_rs,"Sub_Category")%></option> <!--#include file="_fpclass/fpdbrgn2.inc"--> </select> </nobr></p> <input type="hidden" name="Category" value="<% = Request.Form("Category") %>"> </form> <%End IF%> </body> </html> _______________________________________________ s_portfolio <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <title>s_portfolio</title> </head> <body> <form BOTID="0" METHOD="POST" action="s_portfolio.asp"> <input type="hidden" name="fpdbr_0_PagingMove" value=" |< "> </form> <table width="100%"> <thead> <tr> <th ALIGN="LEFT"><b>Category</b></th> <th ALIGN="LEFT"><b>Sub_Category</b></th> <th ALIGN="LEFT"><b>Description</b></th> <th ALIGN="LEFT"><b>Image_File_Name</b></th> <th ALIGN="LEFT"><b>Photographer_Name</b></th> </tr> </thead> <tbody> <!--#include file="_fpclass/fpdblib.inc"--> <% if 0 then %> <SCRIPT Language="JavaScript"> document.write("<div style='background: yellow; color: black;'>The Database Results component on this page is unable to display database content. The page must have a filename ending in '.asp', and the web must be hosted on a server that supports Active Server Pages.</div>"); </SCRIPT> <% end if %> <% fp_sQry="SELECT * FROM Image_records WHERE (Category = '::Category::') ORDER BY Category ASC,Sub_Category ASC" fp_sDefault="Category=" fp_sNoRecords="<tr><td colspan=5 align=""LEFT"" width=""100%"">No records returned.</td></tr>" fp_sDataConn="Database1" fp_iMaxRecords=256 fp_iCommandType=1 fp_iPageSize=5 fp_fTableFormat=True fp_fMenuFormat=False fp_sMenuChoice="" fp_sMenuValue="" fp_sColTypes="&ID=3&Category=202&Sub_Category=202&Description=202&Image_File_Name=202&Photographer_Name=202&Photographer_Pic_File_Name=202&Remote_computer_name=202&User_name=202&Browser_type=202&Timestamp=135&" fp_iDisplayCols=5 fp_fCustomQuery=False BOTID=0 fp_iRegion=BOTID %> <!--#include file="_fpclass/fpdbrgn1.inc"--> <tr> <td> <%=FP_FieldVal(fp_rs,"Category")%></td> <td> <%=FP_FieldVal(fp_rs,"Sub_Category")%></td> <td> <%=FP_FieldVal(fp_rs,"Description")%></td> <td> <%=FP_FieldVal(fp_rs,"Image_File_Name")%></td> <td> <%=FP_FieldVal(fp_rs,"Photographer_Name")%></td> </tr> <!--#include file="_fpclass/fpdbrgn2.inc"--> </tbody> </table> </body> </html> _______________________________________________ Cheers Rob.
|
|
|
|