PDA

Click to See Complete Forum and Search --> : Urgent - please help....buttons!!


turfbult
Jun 6th, 2001, 05:22 AM
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!!


<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)

<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

chrismitchell
Jun 6th, 2001, 05:55 AM
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. :)

monte96
Jun 6th, 2001, 11:23 AM
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:


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

turfbult
Jun 7th, 2001, 12:30 AM
----------------------