• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 216
  • Last Modified:

werid output in the "input" of the form?

in the perl file:

I have

$firstName = "a b c";


and

in the form, I put
print"<input type ='text' input name='firstName' value=$firstName >\n";

while I check the output of it, it only
show in the input text of $firstName as
"a" not "a b c", why?
0
syu2
Asked:
syu2
1 Solution
 
maneshrCommented:
you have to print the line as follows...

print"<input type ='text' input name='firstName' value=\"$firstName\">\n";


NOTE: the \" and \" before and after $firstName. Without these quotes, HTML reads  value=a b c and therfore accepts only a.

With the quotes it will be read as value="a b c"

0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now