hi John,
so, you have a getUser query on your page which, presumably,
returns all
user detils you want to show. you are also, presumably,
outputting that
query's result usinf a <cfoutput query="getUser"> (and
iside of this
cfoutput you have the links and images).
i am also assuming your output is NOT table-based (hence
using <div>
tags; if it is table-based, you can add appropriate id's to
corresponding table cells directly instead of divs):
first, the html/cfml:
(note the added id attribute in the <img> tag!!! [need
it to dynamically
change the alt text of image])
<cfoutput query="getUser">
<p><a href="##"
onClick="onClickShowDetails(#getUser.clubID#);"><img
src="images/square.gif" id="img_#getUser.ClubID#" alt="Show
User
Details" width="10" height="10" border="0"></a>[some
other output here,
i.e. user name, etc]</p>
<div id="userdata_#getUser.clubID#" style="display:none;
visibility:hidden;">
[user details output goes here in whichever layout you want]
</div>
</cfoutput>
javascript function - put in the <head> section of the
page:
(don't forget to change <sc_ript> tags to proper tags
if you are
copying&pasting!!!)
<sc_ript type="text/javascript">
function onClickShowDetails(userid){
if(document.getElementById("userdata_"+userid).style.visibility=="hidden")
{
document.getElementById("userdata_"+userid).style.visibility="visible";
document.getElementById("userdata_"+userid).style.display="block";
document.getElementById("img_"+userid).alt=="Hide User
Details";
} else {
document.getElementById("userdata_"+userid).style.visibility="hidden";
document.getElementById("userdata_"+userid).style.display="none";
document.getElementById("img_"+userid).alt=="Show User
Details";
}
}
</sc_ript>
this should work just fine, but let me know if you are having
problems.
--
Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com