aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes moving information from one web page to another Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "moving information from one web page to another " Watch "moving information from one web page to another " New topic
Author

moving information from one web page to another

Donna Bachner
Ranch Hand

Joined: Oct 08, 2004
Posts: 109
I'm doing a website in HTML and want to get information from one page to another. It's a mock e-commerce site I want to price to follow with the pages. I have the following which does not work. Note the alert works.
<script language="javascript" type="text/javascript">

function purchase(checkboxform)
{
var num = checkboxform.length;
for(var i = 0; i< num; i++)
{
if(checkboxform[i].checked)
{
alert("Brunelleschi's Dome is "+checkboxform[i].value);
document.write("cart.html.form1.Price.value = checkboxform[i].value");
}
}


}
</script>

--------------------------------------------------------------------------------
Pavan Keely
Ranch Hand

Joined: Jun 30, 2006
Posts: 62
Donna,

Are those HTML pages opened in the browser when you access this script ? If you have window reference to the other page, then you can use,

windowRef.form1.Price.value = checkboxform[i].value.

If you don;t have those pages open in the browser and the second page is the result of a form submission (or some other way) then you can use cookies/hidden HTML fields/server side sessions. Not sure what you are looking for.


Pavan Keely<br /><a href="http://keelypavan.blogspot.com" target="_blank" rel="nofollow">http://keelypavan.blogspot.com</a>
Donna Bachner
Ranch Hand

Joined: Oct 08, 2004
Posts: 109
It's a submission page I am taking a product to a shopping cart. If it's server side we are not supposed to mess with it. but I would like to know how anyway. Thanks
Pavan Keely
Ranch Hand

Joined: Jun 30, 2006
Posts: 62
You are not supposed to mess with server side ? Anyways, you have to use session variables to do these.

If you didn't mean to mess up with server side, what was the specified script written for ? To set that value in one of the hidden varibles in the same page ?
Pavan Keely
Ranch Hand

Joined: Jun 30, 2006
Posts: 62
If you don;t want to do that on server side, you can client side cookies for that.
Donna Bachner
Ranch Hand

Joined: Oct 08, 2004
Posts: 109
How do you do that?
Donna Bachner
Ranch Hand

Joined: Oct 08, 2004
Posts: 109
I think I got the idea of making a cookie from the w3c. I'll let you know if it works.
Pavan Keely
Ranch Hand

Joined: Jun 30, 2006
Posts: 62
Donna,

I found a resource for you.

http://www.echoecho.com/jscookies02.htm

In the first page, you set the cookie for the price or whatever that is and after the submission page comes back to the client, you can read the same cookie. Please see the functions text provided in that URL. Basically, you set and get the cookie using document. cookie.

I hope this helps.
Donna Bachner
Ranch Hand

Joined: Oct 08, 2004
Posts: 109
I think I got it working thanks for the help.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: moving information from one web page to another