[Logo]
Forums Register Login
taking value w/o submit
Hi
was wondering if there was any way that i could navigate from page1 to page2 via a link, but also keeping a text value without submit(maybe by setting it in request or session scope).

thanks
The fact that you mention request and session scope makes this not an HTML question, but a JSP one.

Moved to the JSP forum.
[ September 30, 2005: Message edited by: Bear Bibeault ]
Well, whenever you click a link you are submitting a request (a GET in this case).

To get a value from one request to the other you could:

1) pass it as a request parameter on the URL
2) store it in a cookie
3) tack it onto session scope (request scope will not do)
4) store it in a DB
5) store it in a file

and so on.

If the value is transient and only needs to be passed from the first page to the send without having to stay around, option (1) makes the most sense.
[ September 30, 2005: Message edited by: Bear Bibeault ]
I know I was not clear with my question should read the "how to ask a smart question" again.

Bear, I know i want to set it to the session scope. but i was having problems getting the actual value from the field.
<%
session.setAttribute( "atribName", how would I get the value here);
%>

How would i do that, actually that's why I thought I should I should post the Q in the javascript forum.
[ September 30, 2005: Message edited by: mannu kapoor ]
Where is the value coming from?
user enters it in a
<input type="text"....>
request.getParameter("param_name");
thank you
a question though, how would i make it work if the user changed the value...
like an "onchange"

this is what i do currently:
<%
String pin = request.getParameter("analyst_pin");
session.setAttribute( "analpin", pin);
%>

obviously this will work only once. how would i do it for onchange
onchange is a Javascript event that takes place on the client machine.

All of your JSP code take place on the server.
Whatever value is sent when the form is submitted is what you will get using request.getParameter.
Wink, wink, nudge, nudge, say no more ... https://richsoil.com/cards



All times above are in ranch (not your local) time.
The current ranch time is
Oct 19, 2017 12:50:59.