aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes passing JS values between 2 pages Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "passing JS values between 2 pages" Watch "passing JS values between 2 pages" New topic
Author

passing JS values between 2 pages

Pradeep Adibatla
Ranch Hand

Joined: Oct 27, 2009
Posts: 336
I have 2 jsp's ...in jsp1 I have a row with two cells empty whose values are created in jsp2 .I should select a row and onclick of button 'go' should proceed to jsp2.In jsp2 I prepare the two values and on click of Add button in jsp2,the values should be passed onto jsp 1 and set in appropriate cells.I wrote a javascript in jsp2 for preparing values and have those 2 values in 2 JS variables.How should i fetch these values and put in the appropriate cell of jsp1? plzzz help me put! thnku...
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60049
    
  65

Please use real words when posting to the forums. Abbreviations such as "plzzz" in place of "please" only serve to make your posts more difficult to read and less likely to generate useful responses.

Please read this for more information.

thanks,
bear
JavaRanch sheriff

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60049
    
  65

Append the values as query parameters on the URL.

And as this is not a JSP question, it's been moved to the HTML/JavaScript forum.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
And how are jsp1 and jsp2 related?

Eric
Pradeep Adibatla
Ranch Hand

Joined: Oct 27, 2009
Posts: 336
Eric, Here it goes... In JSP 1 I have a table with 6 columns... Initially in the JSP1 the table contains only a header.The rows for the table are added dynamically and only for column values are added in this JSP via a form.The remaining two values should be obtained from JSP-2 which is precisely created to send those 2 values

For example I added 4 rows i.e The table now contains 4 rows with the first four row-column values filled up and the remaining two columns of all rows left empty.
Now the user is supposed to select a row and click on 'Fetch' button in JSP-1 to go to JSP-2 to for fetching values .In JSP-2, I prepared the values and have them in two JS variables,var-1 containing value for one of the two empty columns and var-2 for the other empty one of selected row of JSP-1.Now in JSP-2 when user click on 'Send' button the control goes back to JSP-1 and these two values should fly and sit in their appropriate places of the two empty columns of the selected row of JSP-1.

What are the ways in achieving this?? I am learning how to append values as query parameters on the URL...

what is the best way?? I am developing in struts-2 ... Badly stuck here!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: passing JS values between 2 pages
 
Similar Threads
using OGNL
a JS value passing issue
setting values in jsp+struts2
setting values for table cells in javascript
passing JS values in struts-2