By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,968 Members | 1,563 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,968 IT Pros & Developers. It's quick & easy.

need help on "value"

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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.