Jump to content

pass a value to another page through js method call?


adredz

Recommended Posts

I have a list of products each boxed in a child division. The parent divisions are controlled through tabs implemented with javascript. So when a tab is clicked, it shows a number of child divisions. Each child division has an event handler which highlights the division when it is clicked simulating a radio-button-selected-state and this is accomplished through javascript again. I have another division which is at the same level of the parent divisions which acts as a submit button. Now what I'd like to happen is that, when the user clicks a child division it will send a number corresponding to the product to a javascript function so it will be available later on to be passed to another page. Then when the submit button is clicked, it will get that number and pass it to another page. I have everything setup except that I don't know how to pass it to another page. One way of passing a value to another page is through this:

 

But what if the value of the product is available only through javascript method call? I tried this:

 

<div id="submit"><a href="http://www.nothing.com/page?product='getproductNum()'"></a><div>

 

However, it's not working. Am I missing something? I am sure there are other better ways to accomplish this task, so feel free to suggest one. Any help would be greatly appreciated.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.