Link to home
Start Free TrialLog in
Avatar of ko78
ko78

asked on

Popup window and history.back

I have a JSP page page1.jsp which posts on another JSP page page2.jsp,
On page1.jsp there is a button that opens a popup window, when user submits page1 he can view a summary on page2 and can click back to change information, back is history.back, when he goes to page1.jsp all the data is there, unless he has clicked on the button to open the popup window on page 1 in this case when he clicks on back the data is gone
Avatar of TheKenman
TheKenman
Flag of United States of America image

Hi ko78,

Can I see a sample of your code?

Thanks.
Avatar of ko78
ko78

ASKER

<Script      language="javascript">
function drawbutton(name,link){
      document.write("<table cellpadding=0 cellspacing=0 class=button height=16><tr><td width='4' background='/PMResources/images/en/itworx/hedge2/btn_left.gif'></td><td nowrap background='/PMResources/images/en/itworx/hedge2/btn_middle.gif'><a class=button href='"+link+"'>"+name+"</td><td width=5 background='/PMResources/images/en/itworx/hedge2/btn_right.gif'></td></tr></table>");
}
function SearchForUser(){
      var features = 'top=0,left=0,width=480,height=300,toolbar=no, menubar=no, scrollbars=no, resizable=yes,location=no, directories=no, status=no'
      var url = "/NASApp/pae/Loan_Request.npm?eventId=Itworx.SearchFieldUIEventHandler&__FieldName=SearchByName&__NodeName=Saved&boxValue=" + document.forms[0].SearchByName.value + "&__rand=" + (new Date()).getTime()
      var w = window.open(url,'FX_Search',features);
      w.focus();
}
</Script>


And this is written in the HTML
<td>
<script language="javascript">
drawbutton('SEARCH','javascript:SearchForUser()')
</script>
</td>

and the back button in page2 is

<td>
<script      language = "javascript">                                    
drawbutton("BACK","javascript:window.history.back();")
</script>
</td>
ASKER CERTIFIED SOLUTION
Avatar of tenacium
tenacium

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I agree.

When the pop-up is opened it takes the place of the 1st page in the browser history. Working around this would be much harder - and more likely to fail - than implementing data persistence.