Newbie needs help with simple script

H

hharry

Hello All,

I'm not very familiar with JavaScript but need to complete a simple
task. I have a page with a listbox. When an option displays, a
corresponding image is displayed in a table cell. In another table
cell, I need to display some accompanying text..this is what I need
help with.

Thanks in advance

Here is my script:

<html>
<head>
<script language="JavaScript">
// Change the Number of Images Here
var maxImages=24

// loads the images into the cache for speedy access
function init()
{
cd_cover = new Array();
for( i=0; i<maxImages; i++)
{
cd_cover = new Image();
cd_cover.src = "cd" + i + ".gif";
}
}


// changes the current picture
function change_picture(x)
{
document.cd_image.src=cd_cover[x].src;
}


function next(x)
{
if(x<maxImages-1)
{
x++;
document.cd_image.src=cd_cover[x].src;
document.frmSubmit.selectBox.selectedIndex=x;
}
else
{
x=0;
document.frmSubmit.selectBox.selectedIndex=x;
document.cd_image.src=cd_cover[x].src;
}
}


function previous(x)
{
if(x>0)
{
x--;
document.cd_image.src=cd_cover[x].src;
document.frmSubmit.selectBox.selectedIndex=x;
}
else
{
x=maxImages-1;
document.frmSubmit.selectBox.selectedIndex=x;
document.cd_image.src=cd_cover[x].src;
}
}

</script>


</head>
<body background="bk.gif" bgcolor="#CCCCCC" leftmargin="0"
topmargin="0" rightmargin="0" bottommargin="0" onLoad="init()">
<form name="frmSubmit">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="166" valign="top">
<table border="0" cellspacing="0" cellpadding="0">
<tr><td align="center"><img src="VPid.gif" alt="" width="166"
height="134" border="0"><br><br></td></tr>
<tr><td align="center"><input type=button value="< Back"
ID="Button1" NAME="Button1"
onclick="javascript:previous(document.frmSubmit.selectBox.options[document.frmSubmit.selectBox.selectedIndex].value);">&nbsp;&nbsp;&nbsp;&nbsp;<input
type=button value="Next >" ID="Button2" NAME="Button2"
onclick="javascript:next(document.frmSubmit.selectBox.options[document.frmSubmit.selectBox.selectedIndex].value);"><br><br></td></tr>
<tr>
<td align="center">
<select
onChange="change_picture(this.options[this.selectedIndex].value)"
name="selectBox" ID="Select1">
<option value="0"> Yahoo Home
<option value="1"> My Yahoo
<option value="2"> HotJobs Home
<option value="3"> Create Resume
<option value="4"> Cut & Paste Resume
<option value="5"> Contact Information
<option value="6"> Summary
<option value="7"> Confirmation
<option value="8"> Get Verified
<option value="9"> VPid step 1
<option value="10"> VPid step 2
<option value="11"> VPid step 3
<option value="12"> VPid step 3 again
<option value="13"> VPid step 3 failure
<option value="14"> VPid verified
<option value="15"> Resume Manager
<option value="16"> Employer
<option value="17"> Employer Search
<option value="18"> Search Results
<option value="19"> Detail Verified
<option value="20"> Verification
<option value="21"> Detail Not Verified
<option value="22"> Request Verification
<option value="23"> Request Sent
</select>
</td>

</tr>

<tr><td align="center"><br><br><br>*DISPLAY ACOMPANYING TEXT
HERE*</td></tr>

</table>
</td>
<td valign="top"><a
href="javascript:next(document.frmSubmit.selectBox.options[document.frmSubmit.selectBox.selectedIndex].value);"><img
name="cd_image" src="cd0.gif" border=0></a></td>
</tr>
</table>
</form>
</body>
</html>
 

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