I think it has something to do with array...but not sure...pls help

Discussion in 'Javascript' started by Lodewijk van Haringhal, Sep 5, 2003.

  1. Please help me with this script. I have two lists in my form. One to choose
    a directory and one to choose a picture. The script bellow works perfect
    without the directory choose function.
    I tried to make the directory choose function myself but I did not succeed.
    I think I made a mistake here: document.pic.src = picLocation[theChoice2] +
    picFile[theChoice];

    Please give me a hint or a solution.
    Thanks!

    the script:

    function changePicture()
    {
    var picFile = new Array ("empty.gif", "01vk.gif", "02vk.gif", "03vk.gif",
    "04vk.gif", "05vk.gif", "06vk.gif", "07vk.gif",
    "08vk.gif", "09vk.gif", "10vk.gif"); //change filename

    var picLocation = new Array ("", "pic/Gif thumbs vk/", "pic2/Gif thumbs
    vk/", "pic3/Gif thumbs vk/",
    "pic4/Gif thumbs vk/", "pic5/Gif thumbs vk/");
    //change filelocation

    /* txt addition
    var picText = new Array ("", "Kaart 1", "Kaart 2", "Kaart 3", "Kaart 4",
    "Kaart 5", "Kaart 6", "Kaart 7", "Kaart 8", "Kaart
    9", "Kaart 10");

    var selection = document.DropPicture.Picture.selectedIndex;
    var selection2 = document.DropPicture.Directory.selectedIndex;
    var theChoice = document.DropPicture.Picture.options[selection].value;
    var theChoice2 = document.DropPicture.Directory.options[selection].value;
    document.pic.src = picLocation[theChoice2] + picFile[theChoice];
    document.all.picWords.innerText = picText[theChoice];

    }
    </SCRIPT>
     
    Lodewijk van Haringhal, Sep 5, 2003
    #1
    1. Advertisements

  2. Don't create directories with spaces in their names. Change 'Gif thumbs vk'
    in something like 'Gif_thumbs_vk'

    JW
     
    Janwillem Borleffs, Sep 5, 2003
    #2
    1. Advertisements

  3. Don't create directories with spaces in their names. Change 'Gif thumbs
    vk'
    Thanks but that is not the problem and solution :(
     
    Lodewijk van Haringhal, Sep 5, 2003
    #3
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.