javascript

ihsaaan

New Member
Why is it when i use more than one word in the textbox.value area it only displays the first word? e.g

<a href="gallery/Toyota_Corolla_1_5_Auto.jpg" onmouseover=document.form1.inf.value="Toyota" " " "Corolla" "2003"><img src="gallery/Toyota_Corolla_1_5_Auto.jpg" alt="Toyota Corolla 1.8ltr, Petrol, 1994 silver Automatic, Front Wheel Drive, Aircon, Front Loader &amp; DVD Player" width="128" height="96">

check it at www.oliva.co.za/cars.html
 

hschmitz

New Member
Your event handlers look like

Code:
onmouseover=document.form1.inf.value="2003 Toyota Corolla Silver Automatic Full House"
onmouseout="document.form1.inf.value=" ""

The code of the event handler should always be enclosed in double qoutes, and the JavaScript strings need to be enclosed in single quotes. So the above example should read

Code:
onmouseover="document.form1.inf.value='2003 Toyota Corolla Silver Automatic Full House'"
onmouseout="document.form1.inf.value=' '"

That should work
 
Top