Skip to main content
January 18, 2007
Answered

How to set height of cfinput type text

  • January 18, 2007
  • 3 replies
  • 1358 views
How do I set the height of a "text box" in ColdFusion? When I look at this in dreamweaver, the box is several rows tall, but when it displays in the browser, it's only one row.

<cfinput type="text" name="Comments" size="40" height="500" width="150" >
    This topic has been closed for replies.
    Correct answer
    Hmmm... just changed it to <textarea name="comments" cols="35" rows="5" ></textarea>

    and it works... didn't even have to worry about Pass Through.

    3 replies

    Inspiring
    January 18, 2007
    > <cfinput type="text" name="Comments" size="40" height="500" width="150" >

    Height and width are not valid attributes for a <input type="text" /> tag.

    Reading this:
    http://livedocs.macromedia.com/coldfusion/7/htmldocs/00000279.htm

    It only applies to Flash forms, or <cfinput type="image">.

    I cannot comment on Flash forms, as I've never had call to use them (well:
    I simply would never create a form in Flash, I guess)... are you creating
    an HTML or a Flash form? If Flash, might be an idea to post this in the
    "Rich Forms" forum.

    Note: irrespective of what <cfinput> might think: there are still no
    attributes height / width for a <input type="image" />. So if any browsers
    support that, it's by accident rather than good planning.

    --
    Adam
    Correct answer
    January 18, 2007
    Hmmm... just changed it to <textarea name="comments" cols="35" rows="5" ></textarea>

    and it works... didn't even have to worry about Pass Through.
    Inspiring
    January 18, 2007
    I think you are confusing the text box and text area controls. I do not
    think most browsers will change the height of a text box like that.