Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

pass variable to next page

Status
Not open for further replies.

schocku

Programmer
Nov 20, 2001
23
US
I have a button and everytime the button is clicked I need to pass a string variable to the next jsp page. Can you please help me with a script for this :

<INPUT type=&quot;button&quot; value=&quot;Edit&quot; onClick=&quot;????&quot;>

Thanks for you help in advance.
 
<INPUT type=&quot;button&quot; value=&quot;Edit&quot; onClick=&quot;location.href='page.jsp?param1=value1&quot;>

Then retrieve the value from the query string as you normally would through jsp.


Adam
while(ignorance==true){perpetuate(violence,fear,hatred);life--};
 
why not use default html form behavior with GET method? this will still work if script is disabled.

<form action=&quot;nextPage.jsp&quot; method=&quot;get&quot;>
<input type=&quot;submit&quot; value=&quot;Edit&quot;/>
<input type=&quot;hidden&quot; name=&quot;myVarName&quot; value=&quot;myValue&quot;/>
</form>

=========================================================
try { succeed(); } catch(E) { tryAgain(); }
-jeff
 
thanks for both your help guys. I used adam's solution since I had a for loop and had to pass the value of the variable for that iteration on click of the edit button.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top