?
Solved

refresh browser without losing page data

Posted on 2003-03-03
4
Medium Priority
?
2,521 Views
Last Modified: 2012-05-04
hello all,
I have a page which has to be refreshed according to a
certain action taken by the user.
The problem is once the page is refreshed ,all the data
that was in the form before (text fields,text area etc.)
is now blank and the user has to wrire the whole thing again.
I know the solution is related to the <div> tag and hidden iframe and some JSP,but i can seem to make the connection and solve this problem.


thank you for your kind help
0
Comment
Question by:ronn1212
[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
4 Comments
 
LVL 4

Expert Comment

by:boxy73
ID: 8056657
Refresh the page by using the submit method of your form and using the same page as the action target. When starting the page, in JSP code, use request.getParameter() to collect the values it already had, and insert them in the form. You can send then via post method.

Be careful those values can be null for the first time the page loads.

0
 

Accepted Solution

by:
kaushikgmehta earned 120 total points
ID: 8070983
I think this code should work for u. Check out let me know.

<%
     String strProcess = "";
     String strData = "";

     try {
          strProcess = request.getParameter("Process");
     }
     catch(Exception e) {
          strProcess = "";
     }

     if ((strProcess != null) && (!strProcess.equals("")) && (strProcess.equals("Y"))) {
          strData = request.getParameter("TxtChecker");
     }
%>
<html>
<head>
<title>Test</title>
<script language = "JavaScript">
function goCheck(FrmName) {
     var strData = document.forms[FrmName].elements['TxtChecker'].value;
     if (strData == "") {
          alert("Enter a value in Textbox!");
          return false;
     }
     else {
          document.forms[FrmName].submit();
     }
}
</script>
</head>

<body>
<form name = "FrmCheck" method = "POST" action = "test.jsp">
<input type = "text" name = "TxtChecker" value = "<%=strData%>">
<input type = "hidden" name = "Process" value = "Y">
<br>
<input type = "button" name = "Check" value = "Try" onClick = "javascript:goCheck('FrmCheck');">
</form>
</body>
</html>
0
 
LVL 35

Expert Comment

by:girionis
ID: 10040893
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

- Points to kaushikgmehta

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

girionis
EE Cleanup Volunteer
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

The Summer 2017 Scholarship Winners have been announced!
Hey fellow admins! This time, I have a little fairy tale for you. As many tales do, it starts boring and then gets pretty gory. I hope you like it. TL;DR: It is about an important security matter, you should read it if you run or administer Windows …
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

777 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