Hi all,
I've got a textarea (in a "review" page) that I'm trying to echo what the user inputed on the previous page, but lines of data are lost.
From the input page:
<textarea name="txtArea" cols="60" rows="7" id="maxcharfield"
onKeyDown="textAreaCounter(this,'add_txt_progressbar1',250)"
onKeyUp="textAreaCounter(this,'add_txt_progressbar1',250)"
onFocus="textAreaCounter(this,'add_txt_progressbar1',250)" ></textarea>
From the "review" page:
// Prior to echo the textarea, I'm doing this to convert newlines to html <br>.
$txtArea = nl2br($txtArea);
...
<textarea name="txtArea" cols="60" rows="7" id="maxcharfield" onKeyDown="textAreaCounter(this,'add_txt_progressbar1',250)" onKeyUp="textAreaCounter(this,'add_txt_progressbar1',250)" onFocus="textAreaCounter(this,'add_txt_progressbar1',250)"><? echo $txtArea; ?></textarea>
If I echo out what's posted:
reset ($HTTP_POST_VARS);
while (list ($key, $val) = each ($HTTP_POST_VARS)) {
echo "<font color='red'>$key</font> $val<br>";
}
I can see that $txtArea does, in fact, have multiple lines of user input (when multiple lines are entered). Yet, on the preview page, most of the input is lost/cut off/truncated so that just the first line is there and a portion of any second line (but not subsequent lines).
The Javascript there is simply to alert the user to the progress of getting to the max of 250 characters limit. It's working as expected.
There are no spaces (that I can tell), in the review page textarea code. I know that can sometimes cause a problem, so it's all one line of code verified in textpad with no newlines or spaces.
I know that I'm not converting the <br> back to newlines prior to echoing it out in the review textarea. At this point, I just want all the lines of data that was entered, to be echo'd back.
Ideas on why I'd be missing data on the "review" page here? 😕