Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

JSP textboxes

Posted on 2006-04-21
4
Medium Priority
?
393 Views
Last Modified: 2008-03-17
In JSP, how do I extract the value of a textbox and assign it to a variable?

<INPUT type=text name='EffectiveDate' size=8>

I want to assign whatever gets entered in this textbox to an variable called effDateVal.

Please let me know.

Thanks.
0
Comment
Question by:vgirijanaidu
2 Comments
 
LVL 55

Accepted Solution

by:
Ryan Chong earned 1000 total points
ID: 16509861
After you form is posted, you can get the textbox's value by using request.getParameter method, like:

<%
      String effDateVal = (request.getParameter("EffectiveDate")==null?"":request.getParameter("EffectiveDate").toString().trim());
      out.println("effDateVal = " + effDateVal);
%>
0
 
LVL 25

Assisted Solution

by:InteractiveMind
InteractiveMind earned 1000 total points
ID: 16511087
(BTW, there's no need for the 'toString()' call—as HttpServletRequest#getParameter() returns a String as it is).
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you are a mobile app developer and especially develop hybrid mobile apps then these 4 mistakes you must avoid for hybrid app development to be the more genuine app developer.
When you discover the power of the R programming language, you are going to wonder how you ever lived without it! Learn why the language merits a place in your programming arsenal.
Six Sigma Control Plans
Starting up a Project

581 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question