Goption
asked on
ASP - change sort order on page
hi all,
hope someone can help me.
i have a page at http://www.gomsmail.co.uk/tools/holidays.asp that i need to have the option to sort by country as opposed to date when someone clicks a button. can you guide me in the right direction to do this?
thanking you much!
hope someone can help me.
i have a page at http://www.gomsmail.co.uk/tools/holidays.asp that i need to have the option to sort by country as opposed to date when someone clicks a button. can you guide me in the right direction to do this?
thanking you much!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
hi,
i tried to add the syntax but get a asp error on the page. please see code below.
thanks for your help ;)
i tried to add the syntax but get a asp error on the page. please see code below.
thanks for your help ;)
<%@LANGUAGE="VBSCRIPT"%>
<%Session.lcid=11273%>
<%
Dim MM_Global_STRING
Set MM_Global_STRING = Server.CreateObject("ADODB.Connection")
MM_Global_STRING.Open("Provider=vfpoledb;Data Source=W:\Webspace\resadmin\globaloption\goms.co.uk\www\Global\Data\holidays.dbf" )
set Recordset1 = Server.CreateObject("ADODB.Recordset")
Recordset1.ActiveConnection = MM_Global_STRING
Recordset1.Source = "SELECT * FROM holidays WHERE BETWEEN(date,date(),DATE()+14) ORDER BY date, region"
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 3
Recordset1.Open()
Recordset1_numRows = 0
%>
<html><!-- InstanceBegin template="/Templates/tools2.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<!-- InstanceBeginEditable name="doctitle" -->
<title>Global Options - International Holidays</title>
<!-- InstanceEndEditable -->
<meta name="description" content="Global Options is a worldwide carrier of time sensitive packages offering international courier and airfreight, stock inventory and control and project management." />
<meta name="keywords" content="courier, airfreight, international courier, international airfreight, international couriers, stock inventory, fulfillment, UK, london, heathrow, hayes, courier, stock control " />
<meta name="robots" content="index,follow" />
<meta name="title" content="Global Options international courier, road freight, air freight and stock inventory services" />
<style type="text/css">
<!--
body {
background-image: url(../images/misc/bgd_dot.gif);
}
-->
</style>
<link href="../global_options.css" rel="stylesheet" type="text/css">
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
<LINK href="../javascript/menu_style.css" rel="stylesheet" type="text/css" >
<SCRIPT language=javascript src="../javascript/menu_dropdown.js"></SCRIPT>
<SCRIPT language=javascript src="../javascript/menu_initialize.js"></SCRIPT>
<script type="text/javascript" language="JavaScript" src="../javascript/site.js"></script>
<!-- InstanceBeginEditable name="head" -->
<script src="../Scripts/AC_RunActiveContent.js" type="text/javascript"></script>
<style type="text/css">
<!--
.style4 {color: #FFFFFF}
-->
</style>
<style type="text/css">
<!--
.style5 {font-size: 12px}
-->
</style>
<style type="text/css">
<!--
.style6 {font-size: 12}
-->
</style>
<style type="text/css">
<!--
.style7 {font-size: 3px}
-->
</style>
<!-- InstanceEndEditable -->
<style type="text/css">
<!--
.style1 {color: #CCCCCC}
.style2 {font-size: 9px; line-height: 1.6em; font-family: Verdana, Arial, Helvetica, Geneva, sans-serif;}
-->
</style>
<link href="../lmi.css" rel="stylesheet" type="text/css">
<link href="../uk/global_options.css" rel="stylesheet" type="text/css">
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onload="init_home();">
<!-- ImageReady Slices (homepage1_splice.psd) -->
<div align="center"><span class="textbgdstyle">Global Options - high quality carrier of time sensitive packages worldwide. <a href="../services/courier.html" class="textbgdstyle">International courier</a> & <a href="../services/roadfreight.html" class="textbgdstyle">transport services</a>, <a href="../services/stock_inventory_control.html" class="textbgdstyle">stock inventory and control</a>, <a href="../services/imports.html" class="textbgdstyle">goods imports</a> and <a href="../services/project_management.html" class="textbgdstyle">project management</a>.</span><br>
<br>
</div>
<table width="801" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="10" class="shadowleft"> </td>
<td width="781"><table width="781" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td width="781"><table width="781" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="8" bgcolor="ffffff"> </td>
<td><table id="Table_01" width="765" height="635" border="0" cellpadding="0" cellspacing="0">
<tr>
<td><table width="765" height="70" border="0" cellpadding="0" cellspacing="0" bgcolor="ffffff" id="Table_01">
<tr>
<td width="551"><img src="../images/misc/logo.jpg" width="351" height="70" alt="Global Options Management Services"></td>
<td width="10" height="70"><img src="../images/10years.jpg" width="72" height="73"></td>
<td width="211" height="70" bgcolor="#FFFFFF"><img src="../uk/images/homepage/online_quote2.gif" alt="Quote" width="211" height="72" border="0" usemap="#Map2Map">
<map name="Map2Map">
<area shape="rect" coords="39,58,210,71" href="file:///C|/Users/arran.GOMSUK/Desktop/goms.co.uk/Templates/contacts/index.html">
<area shape="rect" coords="18,43,210,56" href="file:///C|/Users/arran.GOMSUK/Desktop/goms.co.uk/Templates/services/rr_form.asp">
<area shape="rect" coords="77,21,211,35" href="mailto:goms@goms.co.uk">
</map></td>
</tr>
</table></td>
</tr>
<tr>
<td height="23" background="../uk/images/menu/menu_bgd_uk.gif"><a id="menu1" onmouseover="swapImage('button1', preloaded[1][1].src)" onmouseout="swapImage('button1', preloaded[1][0].src)" href="../about/index.html"><img src="../images/menu/1-0.gif" alt="About Global" width="92" height="23" border="0" id="button1" name="button1"></a><a id="menu2" onmouseover="swapImage('button2', preloaded[2][1].src)" onmouseout="swapImage('button2', preloaded[2][0].src)" href="../services/index.html"><img src="../images/menu/2-0.gif" alt="Services" width="92" height="23" border="0" id="button2" name="button2"></a><a id="menu3" onmouseover="swapImage('button3', preloaded[3][1].src)" onmouseout="swapImage('button3', preloaded[3][0].src)" href="../case_studies/index.html"><img src="../images/menu/3-0.gif" alt="Case Studies" width="92" height="23" border="0" id="button3" name="button3"></a><a id="menu4" onmouseover="swapImage('button4', preloaded[4][1].src)" onmouseout="swapImage('button4', preloaded[4][0].src)" href="../contacts/index.html"><img src="../images/menu/4-0.gif" alt="Contact us" width="85" height="23" border="0" id="button4" name="button4"></a><a id="menu5" onmouseover="swapImage('button5', preloaded[5][1].src)" onmouseout="swapImage('button5', preloaded[5][0].src)" href="../client_login/index.asp"><img src="../images/menu/5-0.gif" alt="Client login" width="85" height="23" border="0" id="button5" name="button5"></a><a id="menu7" onmouseover="swapImage('button7', preloaded[7][1].src)" onmouseout="swapImage('button7', preloaded[7][0].src)" href="index.html"><img src="../images/menu/7-0.gif" alt="Useful Tools" width="85" height="23" border="0" id="button7" name="button7"></a><a id="menu6" onmouseover="swapImage('button6', preloaded[6][1].src)" onmouseout="swapImage('button6', preloaded[6][0].src)" href="../uk/index.html"><img src="../images/menu/6-0.gif" alt="Useful Tools" width="45" height="23" border="0" id="button6" name="button6"></a></td>
</tr>
<tr>
<td width="765" height="140" valign="top" bgcolor="#FFFFFF"><!-- InstanceBeginEditable name="stage" -->
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="765" height="140">
<param name="movie" value="../flash/go_new_york2.swf">
<param name="quality" value="high">
<param name="menu" value="false">
<param name='wmode' value='transparent'>
<embed src="../flash/go_new_york2.swf" quality="high" wmode="transparent" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="765" height="140"></embed>
</object>
<!-- InstanceEndEditable --></td>
</tr>
<tr>
<td width="765" height="402" valign="top" bgcolor="ffffff"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="1" background="../images/misc/dots_across2.gif"></td>
</tr>
<tr>
<td><table id="Table_" width="763" height="400" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="200" valign="top"><table width="195" border="0" cellpadding="0" cellspacing="0">
<tr valign="top">
<td height="30" colspan="3"><img src="../images/case_studies.gif" width="189" height="24"></td>
</tr>
<tr>
<td height="12" colspan="3" valign="bottom"><img src="../images/menu/submenu/menusplit2.gif" width="195" height="8"></td>
</tr>
<tr>
<td width="15" height="12"> </td>
<td width="171" class="menustyle"><a href="calc.html" class="menustyle">Dimensional Weight Calculator</a> </td>
<td width="9"> </td>
</tr>
<tr>
<td height="8" colspan="3"><img src="../images/menu/submenu/menusplit2.gif" width="195" height="8"></td>
</tr>
<tr>
<td height="12"> </td>
<td class="menustyle">International Transit Times</td>
<td> </td>
</tr>
<tr>
<td height="8" colspan="3"><img src="../images/menu/submenu/menusplit2.gif" width="195" height="8"></td>
</tr>
<tr>
<td height="12"> </td>
<td width="171" class="menustyle"><a href="holidays.asp" class="menustyle">International Holidays</a> </td>
<td> </td>
</tr>
<tr>
<td height="8" colspan="3"> </td>
</tr>
<tr>
<td height="12" colspan="3"> </td>
</tr>
<tr>
<td height="8" colspan="3"> </td>
</tr>
<tr>
<td height="12" colspan="3"> </td>
</tr>
<tr>
<td height="8" colspan="3"> </td>
</tr>
<tr>
<td height="12" colspan="3"> </td>
</tr>
<tr>
<td height="8" colspan="3"> </td>
</tr>
<tr>
<td height="12" colspan="3"> </td>
</tr>
<tr>
<td colspan="3"> </td>
</tr>
</table></td>
<td width="1" valign="top" background="../images/misc/dots_down.gif"><img src="../images/misc/spacer.gif" width="1" height="1"></td>
<td width="551" valign="top"><table width="551" border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="3"> </td>
</tr>
<tr>
<td width="20"> </td>
<td width="508"><!-- InstanceBeginEditable name="Title" --><!-- InstanceEndEditable --></td>
<td width="23"> </td>
</tr>
<tr>
<td colspan="3" height="5"></td>
</tr>
<tr>
<td> </td>
<td valign="top"><!-- InstanceBeginEditable name="Content" -->
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="60%" valign="top"><p class="bodystyle">International Holidays are shown to the right, <br>
please note
that these are listed in date order <br>
and
cover the next 14 days.<br>
sssss<br>
To list by Country please click HERE<br>
<br>
To recieve holiday notifications by email please <br>
click HERE</p>
<p><br>
<br>
</p></td>
<td width="40%" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="2%" rowspan="3"> </td>
<td width="83%" height="20" valign="middle" bgcolor="#00345A"><span class="style4 style5 style6"><strong>Country</strong></span></td>
<td width="15%" valign="middle" bgcolor="#00345A"><span class="style4 style6"><strong>Date</strong></span></td>
</tr>
<tr>
<td><span class="style7"> </span></td>
</tr>
<tr>
<td colspan="2" bgcolor="#E2E2E2"><%
While (NOT Recordset1.EOF)
%>
<%
Response.Write("<tr>" & chr(10))
Response.Write("<td height=""16""> </td>" & chr(10))
Response.Write ("</a></td>" & chr(10))
Response.Write("<td><span class=""menustyle"">"&Recordset1.Fields.Item("region").Value&"</span></td>" & chr(10))
Response.Write("<td><span class=""menustyle"">"&Recordset1.Fields.Item("date").Value&"</span></td>" & chr(10))
Response.Write("<td></td>" & chr(10))
Response.Write("</tr>" & chr(10))
%>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
Recordset1.MoveNext()
Wend
%></td>
</tr>
<tr>
<td> </td>
<td colspan="2"> </td>
</tr>
</table></td>
</tr>
</table>
<!-- InstanceEndEditable --></td>
<td> </td>
</tr>
</table>
<br>
<br></td>
</tr>
</table></td>
</tr>
<tr>
<td height="2" background="../images/misc/dots_across3.gif"></td>
</tr>
</table></td>
</tr>
</table></td>
<td width="8" bgcolor="ffffff"> </td>
</tr>
<tr>
<td colspan="3" bgcolor="ffffff" height="10"></td>
</tr>
<tr>
<td colspan="3" bgcolor="ffffff" height="15"><table width="780" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="7"> </td>
<td width="54"><img src="../images/accreditations/nqalogo.gif" alt="Global Options NQA ISO 9001-2000" width="54" height="40"></td>
<td width="10"> </td>
<td width="50" valign="top"><img src="../images/accreditations/fsb.gif" alt="Global Options is a member of Federation of Small Business" width="46" height="46"></td>
<td width="7"> </td>
<td width="93"><img src="../images/accreditations/fact.gif" alt="Global Options is a member of Federation Against Copyright Theft - FACT" width="90" height="31"></td>
<td width="7"> </td>
<td width="54"><img src="../images/accreditations/aices.gif" alt="Global Options is a member of AICES" width="53" height="41"></td>
<td width="7"> </td>
<td width="77"><img src="../images/accreditations/dot.gif" alt="Global Options is a listed Agent of Department for Transport" width="72" height="36"></td>
<td width="410" valign="top"><a href="../about/quality_and_accreditations.html"><img src="../images/homepage/quality.gif" alt="Global Options quality standards and accreditations" width="403" height="46" border="0"></a></td>
</tr>
</table></td>
</tr>
<tr>
<td colspan="3" bgcolor="ffffff" height="2"></td>
</tr>
</table></td>
</tr>
</table></td>
<td width="10" class="shadowright"> </td>
</tr>
<tr>
<td style="background: #00345b url(../newimg/bgshadow-bot-left.gif) repeat-y scroll right top; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" valign="top"></td>
<td style="background: #00345b url(../newimg/bgshadow-bot.gif) repeat-x scroll left top; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" align="right">
<div style="height: 10px; font-size: 5px;"> </div></td>
<td style="background: #00345b url(../newimg/bgshadow-bot-right.gif) repeat-y scroll left top; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" valign="top"></td>
</tr></td>
</table>
<table width="800" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><span class="footer style1">
<div align="center"><font class="footer"><a href="http://www.goms.co.uk/uk/about/index.html" class="footer">Global Options Management Services Limited</a> offers <a href="http://www.goms.co.uk/uk/services/courier.html" class="footer">international courier</a> and <a href="http://www.goms.co.uk/uk/services/index.html" class="footer">transport services</a> including <a href="http://www.goms.co.uk/uk/services/airfreight.html" class="footer">airfreight</a> and <a href="http://www.goms.co.uk/uk/services/roadfreight.html" class="footer">road freight</a>, <a href="http://www.goms.co.uk/uk/services/stock_inventory_control.html" class="footer">stock inventory and control</a>, goods <a href="http://www.goms.co.uk/uk/services/imports.html" class="footer">imports worldwide</a> and <a href="http://www.goms.co.uk/uk/services/project_management.html" class="footer">project management</a>. <a href="http://www.goms.co.uk/uk/about/index.html" class="footer">Global Options</a> is a leading provider of <a href="http://www.goms.co.uk/uk/services/courier.html" class="footer">worldwide courier delivery services</a> for time-sensitive packages and documents, known for offering the <a href="http://www.goms.co.uk/uk/about/quality_and_accreditations.html" class="footer">highest service levels in the courier and transport industry</a>. <br>
<br>
<font class="footer">Copyright © Global Options Management Services Limited 2009</font>. All rights reserved.</font> <span class="style1"><a href="http://www.goms.co.uk/uk/site_map.html" class="footer">Site map</a>.</span></div>
</span></td>
</tr>
</table>
<p><br>
<!-- End ImageReady Slices -->
</p>
</body>
<SCRIPT language=javascript src="../javascript/menu_content.js"></SCRIPT>
<strong></strong>
<!-- InstanceEnd --></html>
ASKER
i sorted it! thanks for your help
dag, could have been a split.
I even made up a demo project for you and everything.
I even made up a demo project for you and everything.
http://www.pcitdad.com/Test/EE/Q_24093971/sort.asp
http://www.pcitdad.com/Test/EE/Q_24093971/Q_24093971.zip