Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Sep 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    New to java, Need your help!!!

    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

    http://wsabstract.com/script/cut173.shtml

  • #2
    Senior Coder
    Join Date
    Mar 2005
    Location
    Portsmouth UK
    Posts
    4,529
    Thanks
    3
    Thanked 511 Times in 498 Posts
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    
    <head>
      <title></title>
    <script language="JavaScript" type="text/javascript">
    /*<![CDATA[*/
    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');
     zxcimgs[zxc0].src=ImagePath+zxcsel.value.split('|')[1];
    
    }
    /*]]>*/
    </script></head>
    
    <body>
    <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"  />
    </div>
    <br />
    <div>
    <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>
    <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>
    <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>
    </select>
    </div>
    </body>
    
    </html>
    Vic

    God Loves You and will never love you less.

    http://www.vicsjavascripts.org/Home.htm

    If my post has been useful please donate to http://www.operationsmile.org.uk/

  • #3
    New to the CF scene
    Join Date
    Sep 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Woah that script rocks! THanks a bunch!!!!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •