473,387 Members | 1,517 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

javascript function does not function for all fields of repeatedrecordset

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
2 1463
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Gowhera Hussain | last post by:
Use This for Learning Only .... Do Not Try To Act Smart HACKING WITH JAVASCRIPT Dr_aMado Sun, 11 Apr 2004 16:40:13 UTC This tutorial is an overview of how javascript can be used to bypass...
8
by: Sue | last post by:
Hello! I am back with another question. Remember I am a new JavaScript student and I am aware that this code does not check for all the possibilities and that as a "NEW" JavaScript student I am...
5
by: Sue | last post by:
After finishing up my first quarter JavaScript on 12/12/03, I decided to improve character checking on my project. In my project I only had to do very basic validation. Therefore, I only had one...
3
by: Andy | last post by:
Hi, I am complete JavaScript novice and would really appreciate some help with this code: ===================================================================== <%@LANGUAGE="VBSCRIPT"...
2
by: akanialaka | last post by:
Hope I can get some help here... I connect to an SQL database using ASP. I can see the records. I have a small (very basic) function written in Javascript. When I use the MoveNext in the...
6
by: =?Utf-8?B?Sm9obiBCdW5keQ==?= | last post by:
Hey guys, I've searched high and low for a way to populate a vb array with data from a javascript array. I can find 50 ways to do it with ASP but not one for VB. I appreciate what help you can...
1
by: anniefs | last post by:
hi help me i m so much stuck int he code and i have no time .... i used ASP VBscipt and javascript functions with MS database javascript function add records in MS DB by using ASP vbscript...
2
by: mdock | last post by:
Hello, I have a javascript grid on my ASP page which displays information about the history of specific units produced in our manufacturing facility. One of the results is the order number on...
4
by: Peter | last post by:
ASP.NET I have an application which use ASP.NET Autocomplete extender which works great. But I have a question how to update all the fields on the screen using Ajax. Users starts typing in a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.