Text area vs. input type=text

Discussion in 'PHP' started by lektrikpuke, May 23, 2008.

  1. #1
    Hi y'all,

    When I enter this:

    echo "Search Keywords:&nbsp;&nbsp;<textarea name=\"column1\" cols=\"60\" rows=\"10\" value=\"".$column1."\"></textarea>";

    It doesn't work.

    But when I enter this:

    echo "Search Keywords:&nbsp;&nbsp;<input type=text name=\"column1\" size=125 value=\"".$column1."\">";

    It does - and by does I mean that the field comes up prepopulated with data (if there is any) from the DB as well as submits data (modified or not) when the form is posted.
     
    lektrikpuke, May 23, 2008 IP
  2. blueparukia

    blueparukia Well-Known Member

    Messages:
    1,564
    Likes Received:
    71
    Best Answers:
    7
    Trophy Points:
    160
    #2
    Try:

    
    <?
    echo "<label>Search Keywords: </label><textarea name='column1' cols='60' rows='10'>$column1</textarea>";
    ?>
    
    PHP:
     
    blueparukia, May 23, 2008 IP
  3. lektrikpuke

    lektrikpuke Well-Known Member

    Messages:
    297
    Likes Received:
    1
    Best Answers:
    1
    Trophy Points:
    113
    #3
    Thanks, that did the trick. :D
     
    lektrikpuke, May 23, 2008 IP