Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Launching a seperate form from within a product page


scotch33

Recommended Posts

Posted

Hi,

 

The brief:

 

Laminate flooring shop wants a floor calculator on the laminate floor product pages.

I am trying to get the calculator to launch in a popup - I am using the code below - taken from the tutorial here...

 

http://www.htmlcodetutorial.com/linking/li...famsupp_73.html

 

The code I am using is as follows..

<script TYPE="text/javascript">
<!--
function popupform(myform, windowname)
{
if (! window.focus)return true;
window.open('', windowname, 'height=200,width=400,scrollbars=yes');
myform.target=windowname;
return true;
}
//-->
</SCRIPT>
<form action="http://somedomain.co.uk/calculator/floorcalc.php" onSubmit="popupform(this, 'calc')">
<button type="submit">Floor Calculator</button>
Note: this opens in a popup window.
</form>

 

However - when I try this on my products page - instead of launching the calculator, the page simply moves on to the basket page instead. Any ideas? I want to use a form o launch the form so I can include the hidden fields of price etc from the appropriate product.

Archived

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

×
×
  • Create New...