Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 9 of 9

Thread: textarea CR

  1. #1
    Regular Coder
    Join Date
    Jun 2002
    Location
    Delaware, USA
    Posts
    138
    Thanks
    0
    Thanked 0 Times in 0 Posts

    textarea CR

    I have a textarea which i don't want to have any carriage returns in. What is the easiest way to prevent the CR?

    Thanks.

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Location
    The Netherlands
    Posts
    217
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Using a <input name="" type="text" /> ?

  • #3
    Regular Coder
    Join Date
    Jun 2002
    Location
    Delaware, USA
    Posts
    138
    Thanks
    0
    Thanked 0 Times in 0 Posts
    it's going to be really big and i want the text wrap.

    Thanks for the suggestion though.

  • #4
    Senior Coder A1ien51's Avatar
    Join Date
    Jun 2002
    Location
    Between DC and Baltimore In a Cave
    Posts
    2,717
    Thanks
    1
    Thanked 94 Times in 88 Posts
    isn't there something with

    wrap="off"
    wrap="virtual"
    wrap="soft"
    wrap="physical"

  • #5
    Regular Coder
    Join Date
    Jun 2002
    Location
    Delaware, USA
    Posts
    138
    Thanks
    0
    Thanked 0 Times in 0 Posts
    yes. but i don't want the person to actually press the "enter" key which would force a carriage return.
    Last edited by tamienne; 07-08-2002 at 06:57 PM.

  • #6
    Regular Coder
    Join Date
    Jun 2002
    Location
    The Netherlands
    Posts
    217
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Can you proces the text using a server side script and delete them?

  • #7
    Regular Coder
    Join Date
    Jun 2002
    Location
    Delaware, USA
    Posts
    138
    Thanks
    0
    Thanked 0 Times in 0 Posts
    unfortunately, i have to do it client-side.

  • #8
    Senior Coder
    Join Date
    Jun 2002
    Posts
    1,404
    Thanks
    2
    Thanked 32 Times in 32 Posts
    <html>
    <head>
    <title>untitled</title>
    <script type="text/javascript" language="JavaScript">

    function noEnter(e) {
    var kC = (e.keyCode) ? e.keyCode : e.which ? e.which : null;
    if (kC) return kC != 13;
    else return true;
    }

    </script>
    </head>
    <body>
    <form>
    <textarea rows="6" cols="32" wrap="virtual" onkeypress="return noEnter(event)">
    </textarea>
    </form>
    </body>
    </html>

  • #9
    Regular Coder
    Join Date
    Jun 2002
    Location
    Delaware, USA
    Posts
    138
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks adios!

    That's exactly what I'm looking for.


  •  

    Posting Permissions

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