Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_jsp thread: RE: Urgent: walking through pages


Message #1 by "Mohammad Jamous" <mjamous@n...> on Tue, 22 May 2001 22:34:45 +0300
When user click the link to another series of pages, instead go directly 
to these pages, u may direct it to a new jsp file

<a href="" onclick="return tryThis();">link</a> 

with tryThis() is a javascript function
<script>
function tryThis() {
  code1 = formName.textfield1.value;
 // form name is the name of the form contains the textfield
  code2 = formName.textfield2.value;
  location.href="'new.jsp?textfield1='"+code1+"'&textfield2='"+code2+"''";
  return false;
}
</script>

and in new.jsp, u save 2 value to a session variable ( get param by 
request.getParameter and save value by session.putValue )

After go through a series of pages, go come back to your first page, in 
there get the new value from those page if any, otherwise get value form 
session... 
</script>

BE HAPPY
Apache

> -----Original Message-----
> From: pro_jsp@p... [mailto:pro_jsp@p...]
> Sent: Tuesday, May 22, 2001 3:58 PM
> To: pro_jsp@p...
> Subject: [pro_jsp] Urgent: walking thruogh pages
> 
> 
> My problem is that I have in one page two text fields, if the user
> knows
> the code (code1 and code2 which represent the values of textfield1 and
> textfield2)he enters them, otherwise,, there is two links beside each
> textfield leading the user to another series of pages and the final one
> returns it to the original page with the selected code, how can I keep
> the
> value of textfield1, when it returns with the value of textfield2,
> in other words, I want to keep the value entered in one textfield when
> the
> user returns back from choosing the value of the other, at the end I
> want
> both values to be there?


  Return to Index