Solved

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

Posted on 2008-06-21
2
387 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
2 Comments
 
LVL 16

Expert Comment

by:rbudj
ID: 21839206
0
 
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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
numbers ascending pyramid 101 191
How  Can  I  resolve   this  Error "java.sql.SQLException: Invalid column index" 4 37
Javasctipt 2 24
How to make a moving character 3 55
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

786 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