Results 1 to 4 of 4

Thread: Urgent - please help....buttons!!

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2000
    Posts
    343

    Angry Urgent - please help....buttons!!

    Hello,

    I have a website using buttons to add products to a shopping basket.
    I now want to replace the normal, dull buttons with an image, but cannot get it to work.

    This is the buttons code....(using the normal button)
    When clicking on the button it calls some Jscript sending 2 variables to the function!!

    Code:
    <input type="button" value="Add -&gt;"
          onClick="copySelected(oLastCombo,this.form.select2)"
          style="font-family: monospace; font-size: 8pt">

    This is what I tried.......(using an image)
    Code:
    <img src="file:///C:/New/images/add.gif"
          onClick="copySelected(oLastCombo,this.form.select2)" width="94" height="21"
          alt="add.gif (463 bytes)">
    I get this error...
    "this.form.select2 is not an object" when using the image as a button.

    PLEASE HELP.

    Thanks
    T

  2. #2
    Fanatic Member chrismitchell's Avatar
    Join Date
    Jan 2001
    Location
    With Hobbes in New Zealand
    Posts
    568
    Instead of keeping the entire line of the src try this :

    code:--------------------------------------------------------------------------------
    <img src="images/add.gif"
    onClick="copySelected(oLastCombo,this.form.select2)" width="94" height="21"
    alt="add.gif (463 bytes)">
    --------------------------------------------------------------------------------

    I think that if the images folder is in the project folder this will be fine.

    I think that should work. Apologies if it doesn't.

  3. #3
    Frenzied Member monte96's Avatar
    Join Date
    Sep 2000
    Location
    Somewhere in AZ
    Posts
    1,379
    Yea.. don't use File://. It will look on the user's C drive.

    You have the right idea though..

    The this you have there I believe refers to the image not the document that you are trying to access. Try this:

    Code:
    <img src="images/add.gif" 
    onClick="copySelected(oLastCombo,document.form.select2)" width="94" height="21" 
    alt="add.gif (463 bytes)">
    oOOo--oOOo
    __/\/\onte96
    oOOo--oOOo
    Senior Programmer/Analyst
    MCP
    [email protected]
    [email protected]


    Your results may vary.. some restrictions may apply.. pricing and participation may vary.. not available in all states.. professional driver closed course..quantities limited..

  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2000
    Posts
    343

    Wink Thanks Guys, I got it going!!

    ----------------------

Posting Permissions

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



Click Here to Expand Forum to Full Width