Web Analytics Made Easy -
StatCounter textarea CR - CodingForum

Announcement

Collapse
No announcement yet.

textarea CR

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new 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
    Using a <input name="" type="text" /> ?

    Comment


    • #3
      it's going to be really big and i want the text wrap.

      Thanks for the suggestion though.

      Comment


      • #4
        isn't there something with

        wrap="off"
        wrap="virtual"
        wrap="soft"
        wrap="physical"
        Tech Author [Ajax In Action, JavaScript: Visual Blueprint]

        Comment


        • #5
          yes. but i don't want the person to actually press the "enter" key which would force a carriage return.
          Last edited by tamienne; Jul 8, 2002, 01:57 PM.

          Comment


          • #6
            Can you proces the text using a server side script and delete them?

            Comment


            • #7
              unfortunately, i have to do it client-side.

              Comment


              • #8
                <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>

                Comment


                • #9
                  Thanks adios!

                  That's exactly what I'm looking for.

                  Comment

                  Working...
                  X