Jump to content

This topic is 8003 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

This is such a great forum, what a wealth of information. Is it possible to sort your data using CDML? Below I have included my search page. It works great however I would like to sort the data. Can someone point me in the right direction. Any help would be great.

<html>

<head>

<title>Search</title>

</head>

<body>

<INPUT TYPE="hidden" NAME="-db" VALUE="conqeue.fp5">

<INPUT TYPE="hidden" NAME="-lay" VALUE="Report">

<INPUT TYPE="hidden" NAME="-format" VALUE="mainpage.html">

<table width="592" height="335" border="0">

<tr>

<td height="26"> <div align="right"><strong><font size="-1" face="Arial, Helvetica, sans-serif">Source

:</font></strong></div></td>

<td><div align="left"><font size="-1" face="Arial, Helvetica, sans-serif">

<select name ="Source">

<option value="" selected>[FMP-Option: Source, list=AddedBy]

</select>

<input type="text" name="Source2">

</font></div></td>

</tr>

<tr>

<td><div align="right"><strong><font size="-1" face="Arial, Helvetica, sans-serif">Priority:</font></strong></div></td>

<td><div align="left"><font size="-1" face="Arial, Helvetica, sans-serif">

<select name ="Priority">

<option value="" selected> [FMP-Option: Priority, list=Priority]

</select>

</font></div></td>

</tr>

<tr>

<td height="26"> <div align="right"><strong><font size="-1" face="Arial, Helvetica, sans-serif">Category:</font></strong></div></td>

<td><div align="left"><font size="-1" face="Arial, Helvetica, sans-serif">

<select name ="Category">

<option value="" selected> [FMP-Option: Category, list=Category]

</select>

</font></div></td>

</tr>

<tr>

<td width="104" height="26"> <div align="right"><strong><font size="-1" face="Arial, Helvetica, sans-serif">Topic:</font></strong></div></td>

<td width="478"><div align="left"><font size="-1" face="Arial, Helvetica, sans-serif">

<input type="text" name="Topic" value="" size=30>

</font></div></td>

</tr>

<tr>

<td><div align="right"><strong><font size="-1" face="Arial, Helvetica, sans-serif">Description:</font></strong></div></td>

<td><div align="left"><font size="-1" face="Arial, Helvetica, sans-serif">

<input type="text" name="Description" value="" size=30>

</font></div></td>

</tr>

<tr>

<td><div align="right"><strong><font size="-1" face="Arial, Helvetica, sans-serif">Recomendation:</font></strong></div></td>

<td><div align="left"><font size="-1" face="Arial, Helvetica, sans-serif">

<input type="text" name="Recomendation" value="" size=30>

</font></div></td>

</tr>

<tr>

<td><div align="right"><strong><font size="-1" face="Arial, Helvetica, sans-serif">Who

Does:</font></strong></div></td>

<td><div align="left"><font size="-1" face="Arial, Helvetica, sans-serif"><strong>

<select name ="WhoDoes">

<option value="" selected> [FMP-Option: WhoDoes, list=Who]

</select>

<input name="WhoDoes" type="text" size="15">

</strong> </font></div></td>

</tr>

<tr>

<td><div align="right"><strong><font size="-1" face="Arial, Helvetica, sans-serif">Comment:</font></strong></div></td>

<td><div align="left"><font size="-1" face="Arial, Helvetica, sans-serif">

<input type="text" name="Comment" value="" size=30>

</font></div></td>

</tr>

<tr>

<td height="26"> <div align="right"><strong><font size="-1" face="Arial, Helvetica, sans-serif">Date:</font></strong></div></td>

<td><div align="left"><font size="-1" face="Arial, Helvetica, sans-serif">

<input type="text" name="Date" value="" size=30>

</font></div></td>

</tr>

<tr>

<td height="26"></td>

<td><div align="left"><font size="-1" face="Arial, Helvetica, sans-serif">

<input type="submit" name="-find" value="Start Search">

</font></div></td>

</tr>

<tr>

<td height="26"></td>

<td><div align="left"><font size="-1" face="Arial, Helvetica, sans-serif">

<input name="reset" type="reset" value="Clear Form">

</font></div></td>

</tr>

</table>

</body>

</html>

[color:red]

Posted

You can use the "-sortfield" tag and the "-sortorder" tag. For example:

<input type="hidden" name="-sortfield" value="source">

<input type="hidden" name="-sortorder" value="descend">

<input type="hidden" name="-sortfield" value="category">

The "CDML Reference" database as some very good explanations of these.

All the best.

Garry

Posted

Thanks for the info, works great. One more thing, can I create a button that gives the user the abilty to select what kind of sorting he or she wants. or does the sort have to be hard coded?

Posted

And for everyone in the peanut gallery who may not have picked up on it, garry's example shows MORE THAN 1 SORT FIELD, so YES you can have multiple subsorts, too. Just pair the -sortfield/-sortorder lines and they are executed top down or first to last.

This topic is 8003 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.