Ask a Question related to ASP Database, Design and Development.
-
Jeremy #1
Newbie Q: calling access data on onclick function
I am working on a page which will post a set of images which can be
clicked upon to show a larger image along with information associated
with the image from the access data table(s) onto a pseudo-window
using CSS (to avoid pop-up blockers). So basically, I call the images
from the table and display them on the page. When one is clicked, a
'window' will open showing the info associated with that particular
image. Given that there will be a large number of pictures (1000+),
each with several data associated with it, using an array is not
practical to pull the data so I'd like to call the data using another
sql call associated with, say, the image name.
Anyone know how I might go about this??
Thanks in advance,
Jeremy
PS: Here is my code so far-
<%@LANGUAGE="JAVASCRIPT"%>
<head>
<script language="JavaScript">
<%
var imgs="";
var ident=0;
var pics = "";
var conn = Server.CreateObject("ADODB.Connection");
var rs = Server.CreateObject("ADODB.Recordset");
var sql1 = "SELECT DISTINCT * FROM Photos, Artists WHERE
Photos.[Artist ID] = Artists.[Artist ID] ORDER BY Photos.Entered
DESC";
conn.Open("DSN=photo");
rs.Open(sql1,conn);
var n=0;
var i=0;
var j=0;
while (!rs.EOF)
{
var img = rs.Fields("Photo").value;
var art = rs.Fields("Artist").value;
var ttl = rs.Fields("Title").value;
var spc = rs.Fields("Species").value;
var dsc = rs.Fields("Description").value;
var org = rs.Fields("Organization").value;
var ad1 = rs.Fields("Address1").value;
var cty = rs.Fields("City").value;
var stt = rs.Fields("State").value;
var zip = rs.Fields("Zip").value;
var cry = rs.Fields("Country").value;
var eml = rs.Fields("Email").value;
var web = rs.Fields("Web").value;
var pics = pics += "<td id=" + i + "
onClick=\"Pic_Do();Pic_Get(this);\"><img name='" + img + "' src
='../images/photos/" + img + "' width='100' height='100'>
<br>\n";
rs.MoveNext();
var imgs = imgs += "src[" + i + "] ='../images/photos/" + img +
"'\n";
i=i+1;
}
rs.Close();
%>
function Pic_Do() {
document.forms['winForm'].className='winShow'
}
function Pic_Get(cell) {
var ident = cell.id;
var src = new Array();
<%=imgs%>
document.images['SelPic'].src = src[ident];
}
</script>
<style type="text/css">
<!--
..pics {
position: absolute;
left: 130px;
top: 115px;
font-size: small;
}
..WinHide {
visibility: hidden;
position: absolute;
height: 1px;
width: 1px;
left: 100px;
top: 120px;
}
..WinShow {
position: absolute;
visibility: visible;
height: 250px;
width: 500px;
left: 100px;
top: 120px;
}
-->
</style>
</head>
<html>
<BODY>
<FORM id="pic" name="picform" class="pics">
<table>
<tr>
<%=pics%>
</tr>
</table>
</FORM>
<span id="win" class="WinHide">
<form name="winForm">
<table>
<tr>
<td>
<img name="SelPic" height="200" width="200"><br>
</td>
<td>
<b>Title: </b><br>
<b>Species: </b><br>
<b>Description: </b><br>
<b>Photographer: </b><br>
<b>Organization: </b><br>
<b>Address: </b><br>
<b>Email: </b><br>
<b>Web Site: </b><br>
</td>
</tr>
</table>
<center>
<input type="Button"
OnClick="document.forms['winForm'].className='WinHide'" value="Close
Window">
</center>
</form>
</span>
</BODY>
</HTML>
Jeremy Guest
-
Calling a php Function from an onClick event
I need to create a hyperlink that calls a php function when clicked. How would I do that (with or without Javascript)? Any feedback is appreciated! -
onClick without loosing data
I have a page with several radio buttons. (Add, Deactivate). When I click on Add, an add form is displayed on a page and when and it works the... -
Calling a function within a function registered to an event
Hey, Just registered and tried to search through the forum for a solution to my problem, but I haven't found anything that could help me. I've... -
Error calling MS-Access Module Function from SQL
Lars wrote: Unfortunately, user-defined procedures in an Access module are only accessible when Access is running. There are security... -
data access in a udf table function
Toralf Kirsten <tkirsten@izbi.uni-leipzig.de> wrote: Yes, you can access tables. For example: CREATE FUNCTION all_tables() RETURNS TABLE (... -
Evertjan. #2
Re: Newbie Q: calling access data on onclick function
Jeremy wrote on 08 jul 2004 in microsoft.public.inetserver.asp.db:
You are making an serverside variant string called pics,> I am working on a page which will post a set of images which can be
> clicked upon to show a larger image along with information associated
> with the image from the access data table(s) onto a pseudo-window
> using CSS (to avoid pop-up blockers). So basically, I call the images
> from the table and display them on the page. When one is clicked, a
> 'window' will open showing the info associated with that particular
> image. [snip]
that you are never using.
So I cannot fathom what you would want to do.
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Evertjan. Guest



Reply With Quote

