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.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.