By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,397 Members | 2,552 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,397 IT Pros & Developers. It's quick & easy.

javascript function does not function for all fields of repeatedrecordset

P: n/a
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_prod...ctFamilySub=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>
Jul 27 '08 #1
Share this Question
Share on Google+
2 Replies


P: n/a
SAM
ha**@canchair.com 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).
The issue can be viewed on the following webpage:
http://www.canchair.com/new_web_prod...ctFamilySub=10
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 ... !
--
sm
Jul 27 '08 #2

P: n/a
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!!!!
Jul 28 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.