Results 1 to 2 of 2

Thread: JS Help

  1. #1
    Join Date
    Aug 2007
    Location
    Oakham England
    Posts
    499

    JS Help

    I made this script to change the src of an image... but its not working...

    can anyone help me?

    HTML Code:
    <SCRIPT language="JavaScript">
    function changeColour(img_name,img_src,value) {
    document[img_name].src="images/watermark.php?path=../"+img_src"&colour="+value;
    }
    </SCRIPT>
    
    
    
    
        <select name="select" id="select" onChange="changeColour('button','img.jpg',this.value)">
          <option value="Colour" selected>Colour</option>
          <option value="BW">BW</option>
        </select>
    
    <IMG NAME="button" SRC="images/watermark.php?path=../DIR/" ALT="Image">
    Streama - Your WordPress Friend
    http://www.streama.co.uk

  2. #2
    Join Date
    Aug 2002
    Location
    Ringwood, NJ
    Posts
    14
    This will work:

    HTML Code:
    <script language="JavaScript" type="text/javascript">
    function changeColour(img_name,img_src,value){
      document[img_name].src="images/watermark.php?path=../"+img_src+"&colour="+value;
    }
    </script>
    It was missing + after the ../"+img_src"

Posting Permissions

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