<!--- 
 Filename: UsingTwoSelectsRelated.cfm
 Created by: Nate Weiss (NMW)
 Purpose: Demonstrates the use of the TwoSelectsRelated custom tag.
--->

<!--- Get ratings and associated films from database --->
<cfquery datasource="ows" name="getRatedFilms">
 SELECT
 r.RatingID, r.Rating,
 f.FilmID, f.MovieTitle
 FROM FilmsRatings r INNER JOIN Films f
 ON r.RatingID = f.RatingID
 ORDER BY r.RatingID, f.MovieTitle
</cfquery>


<html>
<head><title>Using a Custom Tag</title></head>
<body>

<h2>Using a Custom Tag</h2>

 <!--- This custom tag will only work in a form --->
 <form>

 <!--- Show ratings and films in correlated SELECT lists --->
 <!--- via custom tag, which generates all needed script --->
 <cf_TwoSelectsRelated
 query="getRatedFilms"
 name1="RatingID"
 name2="FilmID"
 display1="Rating"
 display2="MovieTitle"
 size1="5"
 size2="5"
 forcewidth1="30"
 forcewidth2="50">

 </form>

</body>
</html>
