Solved

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

Posted on 2008-06-21
2
385 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

760 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now