Results 1 to 6 of 6

Thread: Using the same Java script twice on a page

  1. #1
    Join Date
    Feb 2006
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Using the same Java script twice on a page

    I would like to use the same Javascript twice on the same page. Is there a work around to do this?

    Basically I am going to add this script in a form and I need them to have the option of selecting two images.

    here is the script:

    Code:
    <script language="javascript"> 
    function changePicture() 
    { 
    var selection = document.DropPicture.Picture.selectedIndex; //grabs what user selected 
    document.pic.src = document.DropPicture.Picture.options[selection].value; //adds 'selection' to grab 'value' 
    } 
    </script>
          <form name="DropPicture">
            <select name="Picture"  onChange="changePicture()">
              <!---Calls The Function--->
              <option selected>Pictures! 
              <option value="1.gif">Picture One 
              <option value="2.gif">Picture Two 
            </select>
          </form></td>
        <td width="84%"><img src="blank.gif" name="pic" border="0">
    thanks,
    Nick

  2. #2
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,878
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Note: Questions regarding multiple script usage are not usually replied to due to their time consuming nature. See this thread for more information, and this tutorial for one possible solution.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends franšais | entiendo espa˝ol | t˘i Ýt hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  3. #3
    Join Date
    Feb 2006
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Ok well thanks anyway. I did see that help page here on Dynamic Forums but the script I am using doesn't have those tags.

    I will keep looking for a fix. I am just a javascript user not a writer so things like this are a bit above me.

    Nick

  4. #4
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,878
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    I posted that sticky not to say "go away," but to point out the links contained within it It does apply to your situation.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends franšais | entiendo espa˝ol | t˘i Ýt hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  5. #5
    Join Date
    Feb 2006
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Ooops didn't mean it that way.

    Actually I found some help over on an html board, someone rewrote the script for me to use.

    thanks, I have used the scripts on Dynamic Drive for the last couple years. Great Site.

    Thanks,
    Nick

  6. #6
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,878
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    I think that sticky ought to be divided into two to prevent confusion.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends franšais | entiendo espa˝ol | t˘i Ýt hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

Bookmarks

Posting Permissions

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