• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 394
  • Last Modified:

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

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
jwright9
Asked:
jwright9
1 Solution
 
rrzCommented:
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

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now