SitePoint Sponsor

User Tag List

Results 1 to 9 of 9
  1. #1
    SitePoint Evangelist nick0161's Avatar
    Join Date
    Oct 2004
    Location
    australia
    Posts
    424
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    enlarging text field of form

    hi all, just a quick easy question.

    how do i make the text box from a form bigger? i want to be able to show over 3000 characters in a text box of a form.

    thanks

    ----
    nick
    ----

  2. #2
    PHP Otaku Gibb's Avatar
    Join Date
    Jul 2004
    Location
    Texas
    Posts
    454
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    this is an HTML forum question, but here ya go:

    Code:
    <input type="text" size="80" />

    edit: or if you're refering to a textarea, than i believe it's

    Code:
    <textarea cols="5" rows="5">text</textarea>
    tho i'm not certain as i dont use any textareas.

  3. #3
    SitePoint Zealot
    Join Date
    Aug 2004
    Location
    Madison, WI
    Posts
    191
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    or
    HTML Code:
    <textarea style="width:500px;height:300px;"></textarea>

  4. #4
    SitePoint Evangelist nick0161's Avatar
    Join Date
    Oct 2004
    Location
    australia
    Posts
    424
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks guys,

    however i haven't got what i wanted yet.
    HTML Code:
    <input type="text" size="80" />
    will make the box nice and long but with only single text height

    the textarea was nice but when i tried to implement it, the form code appeared in the box. here's where i'm at, atm

    PHP Code:
    echo'<form method="post" height="200" action="comment.php">';
    //echo '<textarea style="width:500px;height:300px;">';
    echo "<input type=\"text\" size=\"80\" name=\"comments\" value=\"$posts\">";
    //echo '</textarea>';
    echo'<input type="submit" name="submit" value="Submit">';
    echo
    '</form>'

  5. #5
    SitePoint Zealot
    Join Date
    Aug 2004
    Location
    Madison, WI
    Posts
    191
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    anything you put in a textarea will be evaluated as plain text, but if you have a text area then you no longer need the text input
    PHP Code:
    echo'<form method="post" height="200" action="comment.php">';
    echo 
    '<textarea style="width:500px;height:300px;" name="comments">';
    echo 
    $posts;
    echo 
    '</textarea>';
    echo
    '<input type="submit" name="submit" value="Submit">';
    echo
    '</form>'

  6. #6
    SitePoint Addict Quaint's Avatar
    Join Date
    May 2004
    Location
    Netherlands
    Posts
    219
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That is because of this:

    You start a textarea by adding the tag: <TEXTAREA>, much the same as you would when you add a text FIELD: <INPUT TYPE="text">. The difference is that you have to CLOSE a Textarea aswell, and the text between the opening and closing Textarea tags will be considered as the default text to display when the page is first loaded (the page that displays your textarea).

    <TEXTAREA STYLE="width: 500px; height: 300px;">
    This text will be regarded as DEFAULT text for this textarea...
    </TEXTAREA>

    What you want to do is:
    PHP Code:
    echo <<<EOD
    <form method="post" height="200" action="comment.php">
    <textarea style="width:500px;height:300px;" name="comments">
    {$posts}
    </textarea><BR>
    <input type="submit" name="submit" value="Submit"><BR>
    </form>
    EOD; 
    This will work perfectly, to my understanding!

  7. #7
    SitePoint Evangelist nick0161's Avatar
    Join Date
    Oct 2004
    Location
    australia
    Posts
    424
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks jinkas, that worked a treat , yeh i should have thought that

    Quaint: i tried what you posted but it had the same effect as what i posted in post #4, but thanks anyway..

    thanks to all


    ----
    nick
    ----

  8. #8
    SitePoint Addict Quaint's Avatar
    Join Date
    May 2004
    Location
    Netherlands
    Posts
    219
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by nick0161
    thanks jinkas, that worked a treat , yeh i should have thought that

    Quaint: i tried what you posted but it had the same effect as what i posted in post #4, but thanks anyway..

    thanks to all


    ----
    nick
    ----
    I know I spotted an error pretty quick, the code I posted (actually just seconds after that) does work!

    Try this post btw:
    http://www.sitepoint.com/forums/showthread.php?t=212232
    It actually discussed the echo <<<EOD technique i've used in your problem!

  9. #9
    SitePoint Evangelist nick0161's Avatar
    Join Date
    Oct 2004
    Location
    australia
    Posts
    424
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    that's cool, thanks for explaining EOD, i had presumed that was what it did, but didn't understand the curly bracket till now..

    thanks again


Bookmarks

Posting Permissions

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