javascript function does not function for all fields of repeatedrecordset

H

haft

My webpage of discussion contains a javascript powered image gallery
of small thumbnail images that when moused-over, display a larger
image that corresponds to the current moused-over thumbnail. An image
caption (whose value is populated by my alt_img database field), also
changes according to the current moused-over thumbnail image. All
functions fine...except...for the initial value for the alt_jmg
database field. The caption text for this initial value does not
display once the thumbnails are moused-over.

When zooming in on the html code that is generated as a result of the
repeated region of the thumbnail images and caption text database
fields, you notice that the alt_img database field is missing. This
should explain why it does not show up on the page.

The question is why only the initial recordset value is missing? What
is preventing the javascript to work properly only for this initial
value?

The issue can be viewed on the following webpage:
http://www.canchair.com/new_web_product_detail.asp?ProductID=198&ProductFamily=1&ProductFamilySub=10

NOW HERE'S THE CODE:

The following head section javascript code contains the function
showBigImage( isource,bigImage,header ) function call of discussion:


JAVASCRIPT HEAD SECTION CODE:


var currentImage;
function showBigImage( isource,bigImage,header ) {
var theImage = document.getElementById( 'largeimage' );
theImage.src = isource;
currentImage = bigImage;
document.getElementById( 'photoHeader' ).innerHTML=header;
document.getElementById( 'largeimage' ).alt=header;


JAVASCRIPT PAGE CODE:


<td height=36 valign="middle" class="small_img"
onmouseover="showBigImage( 'imagescript.asp?path=<%=
images.Fields.Item( "url_img" ).Value %>&width=250','<%=
images.Fields.Item( "url_img" ).Value %>','<
%=(images.Fields.Item("alt_img").Value)%>' )"><img
src="imagescript.asp?path=<%= images.Fields.Item( "url_img" ).Value
%>&width=36" border="0" > </td>


RENDERED REPEAT REGION RECORDSET CODE - THIS CODE ILLUSTRATES THE
ISSUE OF DISCUSSION:


The following rendered looped recordset code illustrates how the
"header" parameter of this showBigImage( isource,bigImage,header )
function call does not render ONLY FOR THE FIRST RECORD OF THE
RECORDSET as it is blank. This "header" value is pulled from the
alt_img database field:


<td height=36 valign="middle"
class="small_img" onmouseover="showBigImage( 'imagescript.asp?
path=images/portable_stage.jpg&width=250','images/
portable_stage.jpg','' )"> <img src="imagescript.asp?path=images/
portable_stage.jpg&width=36" border="0" alt="" > </td>


<td height=36 valign="middle"
class="small_img" onmouseover="showBigImage( 'imagescript.asp?
path=images/seated_riserset.jpg&width=250','images/
seated_riserset.jpg','Portable stage configuration using 9 units of
the 3 ft x 8 ft platforms in 3 different heights' )"> <img
src="imagescript.asp?path=images/seated_riserset.jpg&width=36"
border="0" alt="" > </td>


<td height=36 valign="middle"
class="small_img" onmouseover="showBigImage( 'imagescript.asp?
path=images/Stageset.jpg&width=250','images/Stageset.jpg','Portable
stage configuration using 16 units of the 4 ft x 8 ft platforms' )">
<img src="imagescript.asp?path=images/Stageset.jpg&width=36"
border="0" alt="" > </td>


<td height=36 valign="middle"
class="small_img" onmouseover="showBigImage( 'imagescript.asp?
path=images/Runset.jpg&width=250','images/Runset.jpg','Portable stage
runset configuration' )"> <img src="imagescript.asp?path=images/
Runset.jpg&width=36" border="0" alt="" > </td>
 
S

SAM

(e-mail address removed) a écrit :
The question is why only the initial recordset value is missing? What
is preventing the javascript to work properly only for this initial
value?

The JS is working properly, even if your html is laborious,
It is your asp which is wrong (or your database).
JAVASCRIPT HEAD SECTION CODE:

var currentImage;

function showBigImage( whatImage, header ) {
currentImage = whatImage.src;
var theImage = document.getElementById( 'largeimage' );
theImage.src = currentImage.replace('width=36','width=250');
theImage.alt = header;
document.getElementById( 'photoHeader' ).innerHTML = header;
}
JAVASCRIPT PAGE CODE:

HTML PAGE CODE, no ?
<td height=36 valign="middle" class="small_img">
<img src="imagescript.asp?path=<%= images.Fields.Item( "url_img" ).Value
%>&width=36" border="0"

onmouseover="showBigImage( this,
'<%= images.Fields.Item("alt_img").Value; %>' );">

</td>


The following rendered looped recordset code illustrates how the
"header" parameter of this showBigImage( isource,bigImage,header )
function call does not render ONLY FOR THE FIRST RECORD OF THE
RECORDSET as it is blank. This "header" value is pulled from the
alt_img database field:

certainly there is nothing about this portabe stage in the database ?
because the 3rd argument of the onmouseover's function is empty.

The JS will not invent these missing datas ... !
 
H

haft

I understand the suspicion that there is no value for the portable
stage in the database. However, there is. And even when I make the
recordset sort in the other direction, the same occurs to the "new"
first record of the recordset and the portable stage caption text DOES
show up as it is then the last value in the recordset. Furthermore,
the problem exists with all other products that I test.

Not sure what the problem is with the initial record only.

Any clues would be much appreciated!!!!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top