...

View Full Version : Resolved Populate text area



Craigy
07-01-2010, 10:43 AM
I am trying to change a text field into a text area. The text box populates fine but when I change it to a field I can't get it to populate

so from

<td><input name="newstext" type="text" id="newstext" value="
<?php
$content = $rows['newstext'];
$content = preg_replace("/<img[^>]+\>/i", "(image) ", $content);
echo $content;
?>" size="15"></td>

to something like


<td> <textarea name="newstext" id="newstext" cols="45" rows="5"value="
<?php
$content = $rows['newstext'];
$content = preg_replace("/<img[^>]+\>/i", "(image) ", $content);
echo $content;
?>" </textarea></td>

Anyone have an idea where I'm going wrong?

abduraooft
07-01-2010, 12:33 PM
Anyone have an idea where I'm going wrong? <textarea> doesn't have a value attribute. You need to alter your code to produce an output like

<textarea>The content goes here...</textarea>

Craigy
07-01-2010, 01:51 PM
D'oh, so there isn't.

Fixed now, thank you for the prod in the right direction.



<td><textarea name="newstext" cols="45" rows="5" wrap="physical"><?php
$content = $rows['newstext'];
$content = preg_replace("/<img[^>]+\>/i", "(image) ", $content);
echo $content;
?></textarea></td>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum