The problem is that to make valid html attributes, you need to have
quotes around the attribute values. Although most modern browsers will let you get
away with not quoting attribute values without a space, the html is not valid.
If there is a space in the attribute value, usually browsers, will treat that as the beginning of another
attribute.
e.g. Your script says:
print "<input name='anyname' value=abc def>";
the browser sees
<input name='anyname' value=abc (and some other
attribute, def, that I don't recognize and which
does not have a value, so I'll ignore it)>
Experiment with various ways of quoting. I use qq();
for all of my html, except when I use the CGI.pm. e.g.
$v = "abc def";
# $v only contains abc def not "abc def"
$html = qq(<input name="anyname" value="$v">);
or...
$v = qq("abc def");
# $v now contains <i>"abc def"</i>
$html = "<input name=\"anyname\" value=$v";
# you could also do it like this:
$c = qq("abc def");
$html = qq(<input name="anyname" value=$c>);
I leave it to you to discover which is easiest for you. Alternately,
you could use the CGI.pm module and let it print the stuff
for you. |