adredz Posted December 15, 2009 Share Posted December 15, 2009 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: <div id="submit"><a href="http://www.nothing.com/page?product=2"></a><div> 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. Quote Link to comment https://forums.phpfreaks.com/topic/185188-pass-a-value-to-another-page-through-js-method-call/ Share on other sites More sharing options...
haku Posted December 15, 2009 Share Posted December 15, 2009 You can pass values across pages using cookies. Quote Link to comment https://forums.phpfreaks.com/topic/185188-pass-a-value-to-another-page-through-js-method-call/#findComment-977640 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.