Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Jun 2010
    Posts
    31
    Thanks
    10
    Thanked 0 Times in 0 Posts

    Populate text area

    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
    PHP Code:
    <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
    PHP Code:
       <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?
    Last edited by Craigy; 07-01-2010 at 12:52 PM.

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,801
    Thanks
    160
    Thanked 2,216 Times in 2,203 Posts
    Blog Entries
    1
    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
    Code:
    <textarea>The content goes here...</textarea>
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • Users who have thanked abduraooft for this post:

    Craigy (07-01-2010)

  • #3
    New Coder
    Join Date
    Jun 2010
    Posts
    31
    Thanks
    10
    Thanked 0 Times in 0 Posts
    D'oh, so there isn't.

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

    PHP Code:
    <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>


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •