View Full Version : New to java, Need your help!!!

09-02-2007, 04:15 PM
Hello there!

I am new to Javascript and i need your help. I can modify most html and php scripts but java i have not really figured out yet.

I am currently building a webpage for my buisness. Its a buisness that we build custom cables for people. I am trying to make it very user friendly for people. What i am trying to do is have 3 drop down menus. 1 for the right connector end 1 for the cable type and 1 for the left connector end. If you get what i mean.

Another thing i want it to do is show an image when you have chosen your selection form the drop down menu.

I have a script that does that very well, my problem is, when i put 3 of these scripts next to each other they stop working. I know my problem is that something in the script needs to make them diffrent so they are not all working as one.. but i cant find where to make them diffrent.

Can anyone help?

This is the script im using


09-02-2007, 04:58 PM
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<script language="JavaScript" type="text/javascript">
var ImagePath='http://www.vicsjavascripts.org.uk/StdImages/';

function zxcShowImage(zxcsel,zxcimgs){
var zxcsels=zxcsel.parentNode.getElementsByTagName('SELECT');
if (zxcsel.selectedIndex<1) return;
for (var zxc0=0;zxc0<zxcsels.length;zxc0++){
if (zxcsels[zxc0]==zxcsel) break;
var zxcimgs=document.getElementById(zxcimgs).getElementsByTagName('IMG');


<div id="tst1" style="position:relative;height:50px;">
<img src="http://www.vicsjavascripts.org.uk/StdImages/Blank.gif" width="100" height="50" /><img src="http://www.vicsjavascripts.org.uk/StdImages/Blank.gif" width="100" height="50" /><img src="http://www.vicsjavascripts.org.uk/StdImages/Blank.gif" width="100" height="50" />
<br />
<select style="width:100px;" onchange="zxcShowImage(this,'tst1');" >
<option value="" >Left End</option>
<option value="part numbers can go here|One.gif" >Type 1</option>
<option value="|Two.gif" >Type 2</option>
<option value="|Three.gif" >Type 3</option>
<select style="width:100px;" onchange="zxcShowImage(this,'tst1');" >
<option value="" >Center</option>
<option value="|Four.gif" >Type 1</option>
<option value="|Five.gif" >Type 2</option>
<option value="|Six.gif" >Type 3</option>
<select style="width:100px;" onchange="zxcShowImage(this,'tst1');" >
<option value="" >Right End</option>
<option value="|Seven.gif" >Type 1</option>
<option value="|Eight.gif" >Type 2</option>
<option value="|Nine.gif" >Type 3</option>


09-02-2007, 06:34 PM
Woah that script rocks! THanks a bunch!!!!