Two dropdowns, second is based on first - is it possible

  • Thread starter Thread starter Dave
  • Start date Start date
D

Dave

I want the user to select a CLASS like A+ N+ from the first dropdown and
only the dates for a specific class populates the second dropdown.

Is it possible using the database results wizard in FP2003?

Thanks

Dave K
 
-----Original Message-----
I want the user to select a CLASS like A+ N+ from the
first dropdown and only the dates for a specific class
populates the second dropdown.

Is it possible using the database results wizard in
FP2003?

Thanks
Dave K

This is possible but messy. You have to:

1. Create an HTML form.
2. Inside that form, run the DRW twice: once for each
drop-down list. (You specify that you want a
drop-down list on page 4 of the wizard.)
3. Configure the second drop-down list to get a
criteria from the first drop-down list.
4. Configure both drop-down lists to cause a
form submission whenever the visitor changes its
value. For example, add this to the <select> tag:
onchange="document.forms[0].submit();"
5. Add combined ASP / JavaScript code to preserve the
values of the list boxes from one form submission to
the next. This will require a script such as this
for each drop-down box, where CategoryID is the
field name.
<script>
for (i = 0;
i < document.forms[0].CategoryID.options.length - 1;
i++) {
if (document.forms[0].CategoryID.options.value
== "<%=request("CategoryID")%>"){
document.forms[0].CategoryID.selectedIndex = i;
break;
}
}
</script>
6. Configure a third DRW to display any/all matching
database record. Then, make one column of that DRW
a hyperlink that passes the selected values to
another form.

The reason for step 6 is that the FrontPage "Save Results
to Database" form handler can't distinguish between form
submissions that are supposed to refresh the second drop-
down list and form submissions that are supposed to update
the database.

All in all, this is pretty messy. You are perilously close
to outgrowing the DRW. It might actually be easier to get
this working in ASP or ASP.NET than to get it working in
the DRW.

Jim Buyens
Microsoft FrontPage MVP
http://www.interlacken.com
Author of:
*----------------------------------------------------
|\---------------------------------------------------
|| Microsoft Office FrontPage 2003 Inside Out
||---------------------------------------------------
|| Web Database Development Step by Step .NET Edition
|| Microsoft FrontPage Version 2002 Inside Out
|| Faster Smarter Beginning Programming
|| (All from Microsoft Press)
|/---------------------------------------------------
*----------------------------------------------------
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top