I am building an access-based ASP/vbscript website with Dreamweaver. I have 3 columns in my database that I'd like results sorted by - company, proposal, and sponsor. The way I do this is by having the user click on an image-based tab with a url parameter that reloads the page with the corresponding sort.
As well as swapping the tabs onMouseOver, I wish to change/swap the tab clicked on by the user to select the sort, so that it is readily apparent to the user what the current sort is. I've attempted to do this with dreamweaver's onClick function (via Design -> behaviors) but my problem is that when the page reloads with the correct sorting, the clicked image reverts to its former 'unclicked' state. Is there anyway to keep track of what image has been clicked, and maintain its 'clicked' status even when the page reloads with the new sort?
Here are some code snippets:
The tabs have links as:
1) proposals.asp?sortby=compa
ny (default - without tab click)
2) proposals.asp?sortby=spons
or
3) proposals.asp?sortby=propo
sal
Here's the actual onClick code: (all on one line)
<a href="proposals.asp?sortby
=company" onMouseOver="MM_swapImage(
'companyOn
','','imag
es/company
On.gif','s
ponsorOff'
,'','image
s/sponsorO
ff.gif','p
roposalOff
','','imag
es/proposa
lOff.gif',
1)" onMouseOut="MM_swapImgRest
ore()"><im
g src="images/companyOn.gif"
name="companyOn" width="102" height="30" border="0" id="companyOn"></a>
<a href="proposals.asp?sortby
=sponsor"o
nClick="MM
_swapImage
('companyO
n','','ima
ges/compan
yOff.gif',
'sponsorOf
f','','ima
ges/sponso
rOn.gif','
proposalOf
f','','ima
ges/propos
alOff.gif'
,1)" onMouseOver="MM_swapImage(
'companyOn
','','imag
es/company
Off.gif','
sponsorOff
','','imag
es/sponsor
On.gif','p
roposalOff
','','imag
es/proposa
lOff.gif',
1)" onMouseOut="MM_swapImgRest
ore()"><im
g src="images/sponsorOff.gif
" name="sponsorOff" width="102" height="30" border="0" id="sponsorOff"></a>
<a href="proposals.asp?sortby
=proposal"
onClick="M
M_swapImag
e('company
On','','im
ages/compa
nyOff.gif'
,'sponsorO
ff','','im
ages/spons
orOff.gif'
,'proposal
Off','','i
mages/prop
osalOn.gif
',1)" onMouseOver="MM_swapImage(
'companyOn
','','imag
es/company
Off.gif','
sponsorOff
','','imag
es/sponsor
Off.gif','
proposalOf
f','','ima
ges/propos
alOn.gif',
1)" onMouseOut="MM_swapImgRest
ore()"><im
g src="images/proposalOff.gi
f" name="proposalOff" width="102" height="30" border="0" id="proposalOff"></a>
Dreamweaver's MM_swapImage fcn looks like:
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arg
uments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=
3)
if ((x=MM_findObj(a[i]))!=nul
l){documen
t.MM_sr[j+
+]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
Any Ideas?
Also, is there any way to substitute the displayed value of a database column from say 'True' to 'No'? I would for instance like to change the output of
<%=(rsProposals.Fields.Ite
m("Key Vote?").Value)%> depending on what the value is...
Thanks.