469,929 Members | 1,751 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,929 developers. It's quick & easy.

need help on "value"

Hi

What's wrong with this line:

document.write('<input style="width: 260px;" type="button"
id="button2" onmouseover="mover(\'button2\',\'green\');"
onmouseout="mover(\'button2\',color2);" value ='+txt6+'
onClick="SetCookie(\'modem\');this.value=txt7";>')

txt6 is 4 words long, but only the first word in the string will show.

Jul 20 '05 #1
1 1253
Demoso <> writes:
Hi

What's wrong with this line:

document.write('<input style="width: 260px;" type="button"
id="button2" onmouseover="mover(\'button2\',\'green\');"
onmouseout="mover(\'button2\',color2);" value ='+txt6+'
onClick="SetCookie(\'modem\');this.value=txt7";>')

txt6 is 4 words long, but only the first word in the string will show.


You must put quotes around attribute values that contain spaces. You
should put them around all attribute values. In your case, if txt6
is "Some random four words", then you write this HTML:
<input .... value =Some random four words onClick= ... >
The browser has no way of knowing that "random" isn't a value-less
attribute.

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Denis Perelyubskiy | last post: by
5 posts views Thread by johnsuth | last post: by
2 posts views Thread by IkBenHet | last post: by
21 posts views Thread by Steven T. Hatton | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.