textarea problem

Discussion in 'Perl Misc' started by Paul Lalli, Apr 26, 2004.

  1. Paul Lalli

    Paul Lalli Guest

    On Mon, 26 Apr 2004, Robin wrote:

    > I have a textarea in a script that displays and when the user submits
    > something it sends the output to the browser from the textarea, why is is
    > that when I press the return key within the textarea and type more text
    > below my carriage return does that text below the carriage not display? I
    > don't have any special parse code, I'm using cgi.pm.


    After everything, you STILL refuse to follow the posting guidelines? What
    part of "post a short but complete program that demonstrates your problem"
    is difficult for you to understand?

    It amazes me you still expect people to help you.
    Paul Lalli, Apr 26, 2004
    #1
    1. Advertising

  2. In article <c6jrk6$ov7$>,
    "Robin" <robin @ infusedlight.net> wrote:

    > I have a textarea in a script that displays and when the user submits
    > something it sends the output to the browser from the textarea, why is is
    > that when I press the return key within the textarea and type more text
    > below my carriage return does that text below the carriage not display? I
    > don't have any special parse code, I'm using cgi.pm.


    When you're entering the text? Or when you are later displaying the
    text?

    If the former, look to the HTML specification -- you may need to specify
    more rows to your textarea. If the latter, you would need to make sure
    that your processing of the data properly handles cases where there are
    embedded newlines.

    Ricky

    --
    Pukku
    Richard Morse, Apr 26, 2004
    #2
    1. Advertising

  3. Paul Lalli

    Paul Lalli Guest

    On Mon, 26 Apr 2004, Robin wrote:

    > > After everything, you STILL refuse to follow the posting guidelines? What
    > > part of "post a short but complete program that demonstrates your problem"
    > > is difficult for you to understand?
    > >
    > > It amazes me you still expect people to help you.

    >
    > ok, I'll demonstrate, I thought this would be an easy one.
    >
    >
    > use strict;
    > use CGI qw :)standard);
    >
    > mainprint ();
    > output();
    >
    > sub mainprint
    > {
    > print header;
    > print <<END;
    > <html><body><form action="thisscript.pl" method="post"><textarea
    > name="test"></textarea></form></body></html>
    > END
    > print "\n";
    > }
    >
    > sub output
    > {
    > if (param ('test'))
    > {
    > print (param ('test'));
    > }
    > }
    >
    > #untested
    >


    Clearly, it's untested. If you had tested it, first you would have found
    there's no submit button. Once you added that in, you'd have found that
    IT WORKS FINE. All the text is displayed no problem. So one more time,
    POST A COMPLETE SHORT PROGRAM DEMONSTRATING YOUR PROBLEM. Why do you have
    so much reluctance to do that? Seriously. I really do not understand.

    > The script prints everything on the first line of the textarea before my new
    > line with the return key.... anyone know why?


    Really? Where? Show me. Give me the URL and the ability to view the
    source code.


    > -Robin
    >
    >
    >
    >
    Paul Lalli, Apr 26, 2004
    #3
  4. Paul Lalli

    Robin Guest

    I have a textarea in a script that displays and when the user submits
    something it sends the output to the browser from the textarea, why is is
    that when I press the return key within the textarea and type more text
    below my carriage return does that text below the carriage not display? I
    don't have any special parse code, I'm using cgi.pm.

    Thanks in advance.

    --
    Regards,
    -Robin
    --
    [ webmaster @ infusedlight.net ]
    www.infusedlight.net
    Robin, Apr 26, 2004
    #4
  5. Paul Lalli

    Robin Guest

    Re: textarea problem + free server

    this is totally off-topic, but for anyone who wants to post and read on a
    free server, I found a good one, it's
    news.f.de.plusline.net
    -Robin
    Robin, Apr 26, 2004
    #5
  6. Paul Lalli

    Robin Guest


    > After everything, you STILL refuse to follow the posting guidelines? What
    > part of "post a short but complete program that demonstrates your problem"
    > is difficult for you to understand?
    >
    > It amazes me you still expect people to help you.


    ok, I'll demonstrate, I thought this would be an easy one.


    use strict;
    use CGI qw :)standard);

    mainprint ();
    output();

    sub mainprint
    {
    print header;
    print <<END;
    <html><body><form action="thisscript.pl" method="post"><textarea
    name="test"></textarea></form></body></html>
    END
    print "\n";
    }

    sub output
    {
    if (param ('test'))
    {
    print (param ('test'));
    }
    }

    #untested


    The script prints everything on the first line of the textarea before my new
    line with the return key.... anyone know why?
    -Robin
    Robin, Apr 26, 2004
    #6
  7. Paul Lalli

    Robin Guest


    > that your processing of the data properly handles cases where there are
    > embedded newlines.


    right, and how would I do this, I've been racking my brains for a while on
    this one... is it % followed by something like %20 is a space that I have to
    replace with a newline.
    -Robin
    Robin, Apr 27, 2004
    #7
  8. Paul Lalli

    Matt Garrish Guest

    Re: what I was doing (originally textarea problem)

    "Robin" <robin @ infusedlight.net> wrote in message
    news:c6k5ii$uhj$...
    >
    > I'm stupid.
    >


    No need to state the obvious when posting here...

    Matt
    Matt Garrish, Apr 27, 2004
    #8
  9. Paul Lalli

    Robin Guest

    I figured it out, sorry for not including a working script.
    -Robin
    Robin, Apr 27, 2004
    #9
  10. Paul Lalli

    Robin Guest

    what I was doing (originally textarea problem)

    "Robin" <robin @ infusedlight.net> wrote in message
    news:c6jrk6$ov7$...
    > I have a textarea in a script that displays and when the user submits
    > something it sends the output to the browser from the textarea, why is is
    > that when I press the return key within the textarea and type more text
    > below my carriage return does that text below the carriage not display? I
    > don't have any special parse code, I'm using cgi.pm.



    I'm posting this so users won't get confused with textareas and cgi.

    it was a problem with the script, not a problem with the textarea or the
    parse code. I was basically reading the lines from a textarea into a text
    file, and before the textarea I'd put a number and then a special string (to
    split) and then an indentifier, post or comment, and then the textarea
    contents. The problem was whenver the textarea input included a newline it
    would screw up the way the file was parsed and printed later on, I finally
    figured out that all I had to do was remove the newlines and replace them
    with "<br>" and then remove the carriage returns and replace them with
    nothing so it would be a "<br>" everytime someone inputed a newline into the
    text area. The code is as follows.
    $posttext = param ('posttext');
    $posttext =~ s/\r/<br>/m;
    $posttext =~ s/\n//m;
    #and then I printed param ('posttext') - and it worked

    I'm stupid.

    --
    Regards,
    -Robin
    --
    [ webmaster @ infusedlight.net ]
    www.infusedlight.net
    Robin, Apr 27, 2004
    #10
  11. Paul Lalli

    Robin Guest

    Re: what I was doing (originally textarea problem)

    "Matt Garrish" <> wrote in message
    news:bvhjc.18190$...
    >
    > "Robin" <robin @ infusedlight.net> wrote in message
    > news:c6k5ii$uhj$...
    > >
    > > I'm stupid.
    > >

    >
    > No need to state the obvious when posting here...
    >
    > Matt


    thanks a lot....
    jesus.
    --
    Regards,
    -Robin
    --
    [ webmaster @ infusedlight.net ]
    www.infusedlight.net
    Robin, Apr 27, 2004
    #11
  12. Paul Lalli

    Matt Garrish Guest

    Re: what I was doing (originally textarea problem)

    "Robin" <robin @ infusedlight.net> wrote in message
    news:c6kmrv$16n9$...
    >
    > "Matt Garrish" <> wrote in message
    > news:bvhjc.18190$...
    > >
    > > "Robin" <robin @ infusedlight.net> wrote in message
    > > news:c6k5ii$uhj$...
    > > >
    > > > I'm stupid.
    > > >

    > >
    > > No need to state the obvious when posting here...
    > >
    > > Matt

    >
    > thanks a lot....
    > jesus.
    >


    I'm no Jesus, but I can turn water into brine...

    Matt
    Matt Garrish, Apr 28, 2004
    #12
  13. Re: what I was doing (originally textarea problem)

    Matt Garrish wrote:

    > I can turn water into brine...


    I'm skeptical - I'll take that claim with a grain of salt. ;-)

    *duck*

    sherm--

    --
    Cocoa programming in Perl: http://camelbones.sourceforge.net
    Hire me! My resume: http://www.dot-app.org
    Sherm Pendley, Apr 28, 2004
    #13
    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. angus
    Replies:
    0
    Views:
    1,148
    angus
    May 20, 2004
  2. Param R.

    textarea problem

    Param R., Oct 28, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    336
    Param R.
    Oct 28, 2004
  3. Augustus
    Replies:
    1
    Views:
    347
    Ken Schaefer
    Sep 10, 2003
  4. Textarea Inside of a textarea

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

Share This Page