DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 2 of 2

Hybrid View

  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




Bookmarks

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


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links