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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.