marybailey
Programmer
I want the text entered in my form to retain its original spacing and new lines. But its not!
Ok. Here goes ...
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
* 3
When I print out the values of the emailsubject and personalmsg as I start to loop thru the form variables in my perl script, it looks like this:
emailsubject:
hi++++++Testing++++again is hi++++++Testing++++again
personalmsg:
hi+%0D%0A++there.%0D%0Atesting%0D%0A++++++++++++again.%0D%0A++++*+1%0D%0A++++*+2%0D%0A++++*+3 is hi+%0D%0A++there.%0D%0Atesting%0D%0A++++++++++++again.%0D%0A++++*+1%0D%0A++++*+2%0D%0A++++*+3
Here is some code which does some formatting with the names and values of the fields.
$name =~ s/%(..)/pack("c",hex($1))/ge;
$name =~ s/\+/ /g;
$value =~ s/%(..)/pack("c",hex($1))/ge;
$value =~ s/\+/ /g;
When I print out the personal msg value after this code it is stripped to one space in between each word.
hi there. testing again. * 1 * 2 * 3 is hi there. testing again. * 1 * 2 * 3
The emailsubject also looks stripped:
hi Testing again
The emailsubject when it is in my email looks like:
hi TESTING again
The personalmsg when it is in my email looks like:
hi there. testing again. * 1 * 2 * 3
So, I am at my wit's end (be that what it is) and I dont know what I am doing wrong. Any help would be GREATLY appreciated.
If you need any further info just ask.
Thanks!
Mrs B
Ok. Here goes ...
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
* 3
When I print out the values of the emailsubject and personalmsg as I start to loop thru the form variables in my perl script, it looks like this:
emailsubject:
hi++++++Testing++++again is hi++++++Testing++++again
personalmsg:
hi+%0D%0A++there.%0D%0Atesting%0D%0A++++++++++++again.%0D%0A++++*+1%0D%0A++++*+2%0D%0A++++*+3 is hi+%0D%0A++there.%0D%0Atesting%0D%0A++++++++++++again.%0D%0A++++*+1%0D%0A++++*+2%0D%0A++++*+3
Here is some code which does some formatting with the names and values of the fields.
$name =~ s/%(..)/pack("c",hex($1))/ge;
$name =~ s/\+/ /g;
$value =~ s/%(..)/pack("c",hex($1))/ge;
$value =~ s/\+/ /g;
When I print out the personal msg value after this code it is stripped to one space in between each word.
hi there. testing again. * 1 * 2 * 3 is hi there. testing again. * 1 * 2 * 3
The emailsubject also looks stripped:
hi Testing again
The emailsubject when it is in my email looks like:
hi TESTING again
The personalmsg when it is in my email looks like:
hi there. testing again. * 1 * 2 * 3
So, I am at my wit's end (be that what it is) and I dont know what I am doing wrong. Any help would be GREATLY appreciated.
If you need any further info just ask.
Thanks!
Mrs B