|
Go
![]() |
New
![]() |
Find
![]() |
Notify
![]() |
Tools
![]() |
Reply
![]() |
|
Hello,
We have an image database, and I'd like the image to be a hot expand record link, as well as a "click here to expand record" statement. Any way to do that? |
|||
|
Yes. I wrote a javascript method to expand a record from anywhere.
Step 1. Put ExpandRecord() in head tag or externally referenced javascript file.
/*
ExpandRecord() emulates the WebPublisher expand link
Peter Tyrrell, Andornot Consulting
*/
function ExpandRecord(recordnum, newWindow)
{
var params = dbtw_params;
var snipA = "";
var snipZ = "";
var myUrl = window.location.href.replace(window.location.search, "");
if (recordnum == 1)
{
snipA = params.indexOf("RN=") + 3;
snipZ = params.indexOf("&", snipA);
params = params.substring(0, snipA) + (recordnum) + params.substring(snipZ, params.length);
myUrl += "?AC=PREV_RECORD" + params;
}
else
{
snipA = params.indexOf("RN=") + 3;
snipZ = params.indexOf("&", snipA);
params = params.substring(0, snipA) + (recordnum-2) + params.substring(snipZ, params.length);
myUrl += "?AC=NEXT_RECORD" + params;
}
if (newWindow && newWindow == true)
{
window.open(myUrl);
}
else
{
window.location.href = myUrl;
}
}
Step 2. In your form call ExpandRecord() from the image onclick or wrap the image in a link tag and call it from there. Supply the form's [RECORD NUMBER] variable as the first parameter. The second parameter is optional, and opens the expanded record in a new window when set to true. <img src="/myimage.gif" onclick="ExpandRecord([RECORD NUMBER])" style="cursor:pointer;" alt="my image" /> Peter Tyrrell, MLIS Senior Consultant Andornot Consulting Inc. http://www.andornot.com/about/developerblog |
||||
|
| Previous Topic | Next Topic | powered by eve community |
| Please Wait. Your request is being processed... |
|

