Hi all,
I'm listing fields from a database that I would like sorted from a dropdown
selection list. Can this easily be done by looping back to the index.cfm
file rather then redirecting to another template. If so, how?
When a user select "books" from the menu I want just the fields with
"books" listed.
Below is my code.
<html>
<head>
<title></title>
<cfscript>
function bgColor(expression,color1,color2) {
if (expression) {
return color1;
} else {
return color2;
}
}
</cfscript>
</head>
<body>
<CFQUERY NAME="GetEnv" DATASOURCE="Profiles">
SELECT profile_ID, env_var, destination
FROM profile
ORDER BY env_var
</CFQUERY>
<P>
<P>
<table width="572" cellpadding="2" cellspacing="0" border="0">
<TR bgcolor="#000000">
<TH class="dirlinks" align="left"><font
color="#ffffff"><b>Alias</b></font></TH>
<TH class="dirlinks" align="left"><font
color="#ffffff"><b>Destination</b></font></TH>
<TH class="dirlinks" align="left"><A HREF="env_Add_Form.cfm"><font
class="navlinks" color="#ffffff"><b>[Add]</b></font></A> <A
HREF="env_Add_Form.cfm"><font class="navlinks"
color="#ffffff"><b>[Close]</b></font> </A></TH>
</TR>
<form name="dsort" action="index.cfm">
<TR bgcolor="blue">
<TH colspan="3" class="dirlinks" align="right">
<select name="ss" size="1" class="navlinks">
<option selected>----- Sort By -----</option>
<option value="sel">List All</option>
<option value="sel">Books</option>
<option value="sel">Reports</option>
<option value="sel">Newsletters</option>
</select>
<input type="submit" name="sel" value="Sort" class="navlinks">
</TH>
</TR>
</form>
<CFOUTPUT QUERY="GetEnv">
<TR bgcolor="#bgColor(currentRow MOD 2,"silver","white")#">
<TD class="navlinks">#GetEnv.env_var#</TD>
<TD class="navlinks">#GetEnv.destination#</TD>
<TD class="navlinks"><A
HREF="env_edit_form.cfm?DID=#GetEnv.env_var#">[Edit]</A></TD>
</TR>
</CFOUTPUT>
</TABLE>
</body>
</html>
-------------------------------------------------------------------------
This email server is running an evaluation copy of the MailShield anti-
spam software. Please contact your email administrator if you have any
questions about this message. MailShield product info: www.mailshield.com
-------------------------------------------------------------------------
This email server is running an evaluation copy of the MailShield anti-
spam software. Please contact your email administrator if you have any
questions about this message. MailShield product info: www.mailshield.com
-----------------------------------------------
To post, send email to [EMAIL PROTECTED]
To subscribe / unsubscribe: http://www.dfwcfug.org