Solved

Textarea-retaining the text value in the textarea after clicking the back button

Posted on 2008-06-21
2
391 Views
Last Modified: 2013-11-24
I have a textarea in a JSP that loses its text value after the back button of the browser is clicked.  I found the following not totally syntactically correct possible solution:

<% String inputtext = "";
if(textarea.getParameter() != "" && != null)
{
inputtext = text.getParameter();
}

//in HTML
<textarea name="textarea" rows="20" cols="20"<%=inputtext%></textarea>

Can someone provide a different way, agree that this way will work, or modify this way?
I'm not near my work PC where I can test this.
Thanks.
0
Comment
Question by:jwright9
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 27

Accepted Solution

by:
rrz earned 500 total points
ID: 21839217
I'm not sure what you are asking here.  You press back button then you press forward button to return ? Is that what you are doing ?  Please restate your question in more detail.   Anyway here is proper JSP code.

<%
     String inputtext = request.getParameter("testarea");
     if(textarea == null || "".equals(inputtext.trim())) inputtext = "none found";
%>
0

Featured Post

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: blockā€¦
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

690 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