Re: Textarea question

Discussion in 'HTML' started by Travis Newbury, Jul 29, 2009.

  1. On Jul 29, 5:29 pm, sheldonlg <sheldonlg> wrote:
    > I have what should be a simple question.  On a form with a textarea, how
    > do you make it so that the user can start a new paragraph?


    Uh, I believe what you want to do is the default behavior....

    <html>
    <head></head>
    <body>
    <form>
    <textarea name="userInput" cols="36" rows="5"></textarea>
    <button type='submit">hey</button>
    </form>
    </body>
    </html>

    Entering text and hitting enter causes a carriage return not
    submitting the form...
     
    Travis Newbury, Jul 29, 2009
    #1
    1. Advertising

  2. Travis Newbury

    dorayme Guest

    In article <>,
    sheldonlg <sheldonlg> wrote:

    > Travis Newbury wrote:
    > > On Jul 29, 5:29 pm, sheldonlg <sheldonlg> wrote:
    > >> I have what should be a simple question. On a form with a textarea, how
    > >> do you make it so that the user can start a new paragraph?

    > >
    > > Uh, I believe what you want to do is the default behavior....
    > >
    > > <html>
    > > <head></head>
    > > <body>
    > > <form>
    > > <textarea name="userInput" cols="36" rows="5"></textarea>
    > > <button type='submit">hey</button>
    > > </form>
    > > </body>
    > > </html>
    > >
    > > Entering text and hitting enter causes a carriage return not
    > > submitting the form...
    > >

    >
    > That didn't work!


    What about:

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
    "http://www.w3.org/TR/html4/strict.dtd">
    <html>
    <head>
    <title>Type away as many paragraphs as you like</title>
    <meta http-equiv="content-type" content="text/html; charset=utf-8">
    </head>
    <body>
    <form id="form" method="post" action="something"
    enctype="multipart/form-data">
    <div>
    <textarea name="mesg" rows="10" cols="50"></textarea>
    <input type="submit" value="Submit">
    </div>
    </form>
    </body>
    </html>

    --
    dorayme
     
    dorayme, Jul 30, 2009
    #2
    1. Advertising

  3. On Jul 29, 8:43 pm, sheldonlg <sheldonlg> wrote:
    > > <textarea name="userInput" cols="36" rows="5"></textarea>

    > <input type="textarea" name="ta" id="ta" value=""/><br />


    Do you not see a difference in these 2 lines?
     
    Travis Newbury, Jul 30, 2009
    #3
  4. Travis Newbury wrote:

    > On Jul 29, 8:43 pm, sheldonlg <sheldonlg> wrote:
    >>> <textarea name="userInput" cols="36" rows="5"></textarea>

    >> <input type="textarea" name="ta" id="ta" value=""/><br />

    >
    > Do you not see a difference in these 2 lines?


    Funnily enough, I was about 99% sure that was the issue (the OP was using a
    single-line text input field instead of a textarea element), and I suppose
    so were many others.

    After all, the URL told it all. I mean the failure to provide a URL.

    Using type="textarea" looks rather funny and proves that the OP did not even
    run syntax validation before posting. Of course, browsers ignore that
    attribute, defaulting to type="text".

    --
    Yucca, http://www.cs.tut.fi/~jkorpela/
     
    Jukka K. Korpela, Jul 30, 2009
    #4
  5. Jukka K. Korpela wrote:
    > Travis Newbury wrote:
    >
    >> On Jul 29, 8:43 pm, sheldonlg <sheldonlg> wrote:
    >>>> <textarea name="userInput" cols="36" rows="5"></textarea>
    >>> <input type="textarea" name="ta" id="ta" value=""/><br />

    >>
    >> Do you not see a difference in these 2 lines?

    >
    > Funnily enough, I was about 99% sure that was the issue (the OP was
    > using a single-line text input field instead of a textarea element), and
    > I suppose so were many others.
    >
    > After all, the URL told it all. I mean the failure to provide a URL.
    >


    common mistake #1

    > Using type="textarea" looks rather funny and proves that the OP did not
    > even run syntax validation before posting.


    common mistake #2
    > Of course, browsers ignore
    > that attribute, defaulting to type="text".


    As it should, same as <input type="bogus" ...

    Just imagine if it didn't ignore bogus attributes and tried to "guess
    what the author intended", talk about a debugging nightmare! Oh wait,
    isn't there a browser that has such inclinations? ;-)


    --
    Take care,

    Jonathan
    -------------------
    LITTLE WORKS STUDIO
    http://www.LittleWorksStudio.com
     
    Jonathan N. Little, Jul 30, 2009
    #5
  6. Travis Newbury

    Tim Streater Guest

    In article <fhlcm.29899$>,
    "Jukka K. Korpela" <> wrote:

    > Travis Newbury wrote:
    >
    > > On Jul 29, 8:43 pm, sheldonlg <sheldonlg> wrote:
    > >>> <textarea name="userInput" cols="36" rows="5"></textarea>
    > >> <input type="textarea" name="ta" id="ta" value=""/><br />

    > >
    > > Do you not see a difference in these 2 lines?

    >
    > Funnily enough, I was about 99% sure that was the issue (the OP was using a
    > single-line text input field instead of a textarea element), and I suppose
    > so were many others.
    >
    > After all, the URL told it all. I mean the failure to provide a URL.
    >
    > Using type="textarea" looks rather funny and proves that the OP did not even
    > run syntax validation before posting.


    Syntax validation would have helped. But the URL issue is irrelevant (as
    is often the case). The OP's providing of his code was entirely
    sufficient, as it was short enough.

    --
    Tim

    "That excessive bail ought not to be required, nor excessive fines imposed,
    nor cruel and unusual punishments inflicted" -- Bill of Rights 1689
     
    Tim Streater, Jul 30, 2009
    #6
  7. Travis Newbury

    Tim Streater Guest

    In article <>,
    Johannes Baagoe <> wrote:

    > sheldonlg :
    >
    > > <input type="textarea" [...]

    >
    > No way, "textarea" cannot be the value of the type attribute in input
    > elements. The only possible values are "text" (the default, that is, what
    > is assumed if you don't set a type attribute), "password", "checkbox",
    > "radio", "submit", "reset", "file", "hidden", "image" and "button".
    >
    > On the other hand, there is a textarea element that does exactly what you
    > seem to want.
    >
    > Perhaps you should try to learn HTML. It is rather useful if one wants to
    > design web pages. http://www.w3.org/TR/html401/
    >
    > It has nothing to do with javascript, though.


    As it turns out. The OP, however, did state originally that he wasn't
    sure whether it might be or not.

    --
    Tim

    "That excessive bail ought not to be required, nor excessive fines imposed,
    nor cruel and unusual punishments inflicted" -- Bill of Rights 1689
     
    Tim Streater, Jul 30, 2009
    #7
  8. Tim Streater wrote:

    > Syntax validation would have helped.


    Surely.

    > But the URL issue is irrelevant (as is often the case).


    Wrong.

    It would have let us do the OP's homework and immediately see what the real
    problem was.

    > The OP's providing of his code was entirely
    > sufficient, as it was short enough.


    He didn't provide it in the question, and he had no way of knowing what
    snippet of code was the relevant part.

    --
    Yucca, http://www.cs.tut.fi/~jkorpela/
     
    Jukka K. Korpela, Jul 30, 2009
    #8
  9. On Jul 30, 2:04 pm, "Jukka K. Korpela" <> wrote:
    > > Do you not see a difference in these 2 lines?

    > Funnily enough, I was about 99% sure that was the issue (the OP was using a
    > single-line text input field instead of a textarea element), and I suppose
    > so were many others.


    So I did good?
     
    Travis Newbury, Jul 30, 2009
    #9
  10. Travis Newbury

    Tim Streater Guest

    In article <mhmcm.29936$>,
    "Jukka K. Korpela" <> wrote:

    > Tim Streater wrote:
    >
    > > Syntax validation would have helped.

    >
    > Surely.
    >
    > > But the URL issue is irrelevant (as is often the case).

    >
    > Wrong.
    >
    > It would have let us do the OP's homework and immediately see what the real
    > problem was.


    Easier just to provide the code, in this instance (as short a section as
    possible of it that exhibits the failure).

    > > The OP's providing of his code was entirely
    > > sufficient, as it was short enough.

    >
    > He didn't provide it in the question, and he had no way of knowing what
    > snippet of code was the relevant part.


    It wasn't a snippet. It was the total code, as he said.

    --
    Tim

    "That excessive bail ought not to be required, nor excessive fines imposed,
    nor cruel and unusual punishments inflicted" -- Bill of Rights 1689
     
    Tim Streater, Jul 30, 2009
    #10
  11. Johannes Baagoe wrote:
    > It has nothing to do with javascript, though.


    So, as you thought you needed to continue the mindless crosspost, or post
    this to a newsgroup at all, why do you not set even an appropriate
    Followup-To header? Two (or more) wrongs make no right.


    F'up2 poster

    PointedEars
    --
    Prototype.js was written by people who don't know javascript for people
    who don't know javascript. People who don't know javascript are not
    the best source of advice on designing systems that use javascript.
    -- Richard Cornford, cljs, <f806at$ail$1$>
     
    Thomas 'PointedEars' Lahn, Jul 30, 2009
    #11
  12. Tim Streater wrote:

    > Easier just to provide the code,


    Of course it's easier. It's easier to behave like an idiot than to do
    something useful.

    > It wasn't a snippet. It was the total code, as he said.


    No it wasn't. It wasn't even an HTML document, and anyone who has read these
    groups for some weeks at least knows that HTML isn't enough (there's a thing
    called "HTTP headers" to begin with), and it surely wasn't the real
    document, as <form> (with no attributes) is not of any use, at least without
    any JavaScript (and there was no JavaScript).

    I'd suggest that you take a break before posting more. Consider the
    Socratean criteria: Is it true? Is it useful? Is it necessary? You have just
    been adding to the noise and seducing newcomers to posting snippets of code.

    --
    Yucca, http://www.cs.tut.fi/~jkorpela/
     
    Jukka K. Korpela, Jul 30, 2009
    #12
  13. Travis Newbury

    Tim Streater Guest

    In article <GSmcm.29955$>,
    "Jukka K. Korpela" <> wrote:

    > Tim Streater wrote:
    >
    > > Easier just to provide the code,

    >
    > Of course it's easier. It's easier to behave like an idiot than to do
    > something useful.


    Now now. No shouting, please.

    > > It wasn't a snippet. It was the total code, as he said.

    >
    > No it wasn't. It wasn't even an HTML document, and anyone who has read these
    > groups for some weeks at least knows that HTML isn't enough (there's a thing
    > called "HTTP headers" to begin with), and it surely wasn't the real
    > document, as <form> (with no attributes) is not of any use, at least without
    > any JavaScript (and there was no JavaScript).


    It was enough in this instance, which is what counts.

    > I'd suggest that you take a break before posting more. Consider the
    > Socratean criteria: Is it true? Is it useful? Is it necessary?


    Much of what is posted in many NGs does not meet these criteria.

    > You have just been seducing newcomers to posting snippets of code.


    Good. I shall continue doing this.

    --
    Tim

    "That excessive bail ought not to be required, nor excessive fines imposed,
    nor cruel and unusual punishments inflicted" -- Bill of Rights 1689
     
    Tim Streater, Jul 30, 2009
    #13
  14. Tim Streater kirjoitti:

    > Now now. No shouting, please.


    What are you talking about? There has been no shouting from JKK
    *ANYWHERE* on Usenet, IIRC. Surely on not this thread.

    > It was enough in this instance, which is what counts.


    Delusion. Have you being paying attention?

    >> I'd suggest that you take a break before posting more. Consider the
    >> Socratean criteria: Is it true? Is it useful? Is it necessary?


    Oops! I guess that only the first criteria applies to me. Maybe the
    second one helps me with my insomnia. Or would that be the 3rd one :)

    >> You have just been seducing newcomers to posting snippets of code.


    > Good. I shall continue doing this.


    Then you are against best practices as described in the NG's (clj)
    FAQ. Is this by choice or ignorance?

    BW, Osmo
     
    Osmo Saarikumpu, Jul 30, 2009
    #14
  15. Travis Newbury kirjoitti:

    > So I did good?


    Nope. You have to start from valid code. It's a prerequisite for
    doing good (at least when providing code for the public).

    BW, Osmo
     
    Osmo Saarikumpu, Jul 31, 2009
    #15
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jukka K. Korpela

    Re: basic textarea question

    Jukka K. Korpela, Jul 15, 2003, in forum: HTML
    Replies:
    0
    Views:
    398
    Jukka K. Korpela
    Jul 15, 2003
  2. Mel
    Replies:
    1
    Views:
    437
    Jukka K. Korpela
    Feb 3, 2004
  3. Augustus
    Replies:
    1
    Views:
    402
    Ken Schaefer
    Sep 10, 2003
  4. Textarea Inside of a textarea

    , Feb 4, 2006, in forum: ASP General
    Replies:
    6
    Views:
    364
    Anthony Jones
    Feb 5, 2006
  5. Replies:
    1
    Views:
    359
    Bart Van der Donck
    Jul 4, 2007
Loading...

Share This Page