Preload a TextArea

Discussion in 'HTML' started by Noel, Jul 28, 2005.

  1. Noel

    Noel Guest

    I have a textarea

    <textarea wrap="hard" name="comment" rows="10" cols="80"></textarea>

    which I want to preload by passing in some text in the URL, so I do

    www.myhost.com/enter_info.cgi?&comment=Line One

    Now this puts "Line One" into my textarea.

    Is it possible to put another line below this e.g. "Line Two" so I see

    Line One
    Line Two

    in my textarea?

    So, basically, I've been trying to figure out is there some code for
    "new line" like the code %20 for a space?

    I can't alter the web page, I can only pass info the information using
    "comment=" in the URL.

    Any help appreciated,

    Noel
     
    Noel, Jul 28, 2005
    #1
    1. Advertising

  2. Noel wrote:

    > I have a textarea
    >
    > <textarea wrap="hard" name="comment" rows="10" cols="80"></textarea>
    >
    > which I want to preload by passing in some text in the URL, so I do
    >
    > www.myhost.com/enter_info.cgi?&comment=Line One
    >
    > Now this puts "Line One" into my textarea.
    >
    > Is it possible to put another line below this e.g. "Line Two" so I see
    >
    > Line One
    > Line Two
    >
    > in my textarea?
    >
    > So, basically, I've been trying to figure out is there some code for
    > "new line" like the code %20 for a space?
    >
    > I can't alter the web page, I can only pass info the information using
    > "comment=" in the URL.
    >
    > Any help appreciated,
    >
    > Noel


    %0a should do it (that the code for a linefeed, but if it works depends on
    your enter_info.cgi)


    --
    Benjamin Niemann
    Email: pink at odahoda dot de
    WWW: http://www.odahoda.de/
     
    Benjamin Niemann, Jul 28, 2005
    #2
    1. Advertising

  3. Noel

    cosmic foo Guest

    "Noel" <> wrote in message
    news:...
    > I have a textarea
    >
    > <textarea wrap="hard" name="comment" rows="10" cols="80"></textarea>
    >
    > which I want to preload by passing in some text in the URL, so I do
    >
    > www.myhost.com/enter_info.cgi?&comment=Line One
    >
    > Now this puts "Line One" into my textarea.
    >
    > Is it possible to put another line below this e.g. "Line Two" so I see
    >
    > Line One
    > Line Two
    >
    > in my textarea?
    >
    > So, basically, I've been trying to figure out is there some code for
    > "new line" like the code %20 for a space?
    >
    > I can't alter the web page, I can only pass info the information using
    > "comment=" in the URL.
    >
    > Any help appreciated,
    >
    > Noel
    >


    how doe this put anything in your textarea?
    lol
     
    cosmic foo, Jul 29, 2005
    #3
  4. "Noel" <> wrote:

    > I have a textarea
    >
    > <textarea wrap="hard" name="comment" rows="10" cols="80"></textarea>


    That's fine, except for the nonstandard and harmful attribute wrap="hard".
    Use wrap="off" instead; equally nonstandard, but useful, since it makes
    wowsers behave the way they are supposed to, in line wrapping (i.e., not
    mess things up by line breaks _they_ introduce).

    > which I want to preload by passing in some text in the URL, so I do
    >
    > www.myhost.com/enter_info.cgi?&comment=Line One


    Stop wanting that.

    If the content is a meaningful and useful default content for _user input_
    (which is what textarea is for), use tools like CGI or PHP to insert the
    external content, or copy it by hand. But I doubt whether name="comment" is
    adequate then. If you are asking for a user comment, why would _you_ want
    to write that comment, or even a default for it?

    Did you really mean www.myhost.com? There's no reason why it could not be a
    real domain, today or tomorrow. So if you actually meant a dummy domain,
    use www.myhost.example or something similar; the .example pseudo-domain is
    guaranteed to remain nonexistent. Better still, tell us the real URL.

    > Now this puts "Line One" into my textarea.


    Maybe, depending on what your undisclosed CGI script does.

    > Is it possible to put another line below this e.g. "Line Two" so I see
    >
    > Line One
    > Line Two
    >
    > in my textarea?


    Of course. It all depends on your CGI script.

    > So, basically, I've been trying to figure out is there some code for
    > "new line" like the code %20 for a space?


    I'm afraid you are basically confused. Why on &Planet; would you want to
    write some complicated URL to have some simple text (passed in the query
    part in an encoded format) inserted, instead of simply inserting the text?

    > I can't alter the web page, I can only pass info the information using
    > "comment=" in the URL.


    _Which_ web page cannot be altered by you? Yours?

    --
    Yucca, http://www.cs.tut.fi/~jkorpela/
    Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html
     
    Jukka K. Korpela, Aug 2, 2005
    #4
    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. Replies:
    0
    Views:
    1,272
  2. Joan

    preload filechooser

    Joan, Aug 1, 2005, in forum: Java
    Replies:
    2
    Views:
    385
    Knute Johnson
    Aug 1, 2005
  3. Augustus
    Replies:
    1
    Views:
    398
    Ken Schaefer
    Sep 10, 2003
  4. Textarea Inside of a textarea

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

Share This Page