marybailey
Programmer
I want the text entered in my form to retain its original spacing.
I have 2 textareas defined in an html form among other fields. They are defined as wrap=VIRTUAL tho wrap=hard and wrap= physical did not change the results.
I put the names and values of my form into an associative array.
My email textarea defined as follows in my html form:
<textarea name="emailsubject" cols="40" wrap="VIRTUAL" rows="1"></textarea><br>
My personalmsg textarea is defined as follows in my html form:
<textarea name="personalmsg" cols="70" wrap="virtual" rows="10"></textarea><br>
This is what I enter in the form:
for the emailsubject, I enter:
hi TESTING again
for the personalmsg, I enter:
hi
there.
testing
again.
* 1
* 2
Here is some code which does some formatting with the names and values of the fields.
# Un-Webify plus signs and %-encoding
$value =~ s/\+/ /g;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$value =~ s/<!--(.|\n)*-->//g;
When I print out the personal msg value after this code it is reduced to one space.
hi
there.
testing
again.
* 1
* 2
Any ideas why?
I have 2 textareas defined in an html form among other fields. They are defined as wrap=VIRTUAL tho wrap=hard and wrap= physical did not change the results.
I put the names and values of my form into an associative array.
My email textarea defined as follows in my html form:
<textarea name="emailsubject" cols="40" wrap="VIRTUAL" rows="1"></textarea><br>
My personalmsg textarea is defined as follows in my html form:
<textarea name="personalmsg" cols="70" wrap="virtual" rows="10"></textarea><br>
This is what I enter in the form:
for the emailsubject, I enter:
hi TESTING again
for the personalmsg, I enter:
hi
there.
testing
again.
* 1
* 2
Here is some code which does some formatting with the names and values of the fields.
# Un-Webify plus signs and %-encoding
$value =~ s/\+/ /g;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$value =~ s/<!--(.|\n)*-->//g;
When I print out the personal msg value after this code it is reduced to one space.
hi
there.
testing
again.
* 1
* 2
Any ideas why?