Repopulating text area quirk.<

windows

Guest
Hi Everyone,

I have a strange problem repopulating my textarea. It seems to have two tabs when I go to edit. The data is being grabbed either from a database or post data.

Any ideas?


<textarea rows="20" cols="50" name="description">
<?php if (isset($_POST['description'])) {
echo stripslashes(trim($_POST['description']));
} else {
if (isset($description)) echo stripslashes(trim($description));
}
?></textarea>may or may not help but make sure you use nl2br(); on the echoed variable when it's multi-line(like a description).Originally posted by ianmh
Hi Everyone,

I have a strange problem repopulating my textarea. It seems to have two tabs when I go to edit. The data is being grabbed either from a database or post data.


two tabs? what tabs?Like tabs when you hit the tab key. When I repopulate my text field, the first line always has two tabs. Doesn't effect anything other than it bugs me. :Pahhh, inside the textarea, you mean spaces. well tha tcould be the way you have things setup. if you can make it all one line.

if (isset($_POST['description'])) {
$content = stripslashes(trim($_POST['description']));
} else {
if (isset($description)) $content = stripslashes(trim($description));
}

<textarea rows="20" cols="50" name="description"><?php echo $content ?></textarea>Thanks soutt, I will try that next time I am working on this. :D
 
Back
Top