The number of lines in an HTML text box.


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: The number of lines in an HTML text box.

  1. #1
    Mohamed Abu Zur Guest

    The number of lines in an HTML text box.



    How can I verify the where the user typed enter (line break) in a
    HTML text box within my servlet?
    I receive the text data by req.getParameter("field");
    But how can calculate the number of lines of text written there?

    Thanks in advance

    Mohamed

  2. #2
    Paul Clapham Guest

    Re: The number of lines in an HTML text box.

    You receive the text into a String, do you not? So you want to find out how
    many "lines" of text are in a String. You can use the indexOf() methods of
    String to search for any character; in your case you want to search for the
    line-end character, which is coded in Java as "\n".

    PC2

    Mohamed Abu Zur <mabuzur@medifusion.com> wrote in message
    news:39d45697$1@news.devx.com...
    >
    >
    > How can I verify the where the user typed enter (line break) in a
    > HTML text box within my servlet?
    > I receive the text data by req.getParameter("field");
    > But how can calculate the number of lines of text written there?
    >
    > Thanks in advance
    >
    > Mohamed




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center