VP-ASP :: Shopping Cart Software

Shopping Cart Software Solutions for anywhere in the World

US/Canada(Toll Free): +1 888 587 2278
Europe/UK: +44 (020) 7193 9408
Australia/New Zealand: +61 3 9016 4497

VP-Cart StoreFront Customer Forum

Home | Profile | Register | Active Topics | Members | Search | FAQ
Save Password
Forgot your Password?

 All Forums
 VPCart Forum
 Adding script to tmp_product.htm
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

VP-ASP New User

186 Posts

Posted - April 14 2007 :  16:14:45  Show Profile  Visit stone5150's Homepage  Reply with Quote
Why can't I add the script below in tmp_product.htm? It works fine in any other HTML page.

<script language="JavaScript" src="richedit.js"></script>
<form name="f1" action="javascript:alert('FIELD 1:\n' + document.f1.richEdit0.value + '\n\nFIELD 2:\n' + document.f1.richEdit1.value)" method="post">
<script language="JavaScript">
var editor1 = new EDITOR();
editor1.create("Preview your stamp layout here");

Edited by - stone5150 on April 15 2007 21:11:35

VP-ASP New User

186 Posts

Posted - April 15 2007 :  22:51:03  Show Profile  Visit stone5150's Homepage  Reply with Quote
I figured out that <iframe> tag works for this.
Go to Top of Page

Senior Member

United Kingdom
1898 Posts

Posted - April 16 2007 :  00:25:52  Show Profile  Visit devshb's Homepage  Reply with Quote
one thing to watch out for if embedding javascript within a template (although this doesn't apply to the example above, it will for a lot of other javascript code), is that if your javascript references an object, like frame[blah] then the [blah] bit will get treated as a vpasp template field and will therefore cause an error. A way around that would be to put the javascript source into a separate file, and then src the file in the template and call the corresponding function in the template.

but, watch out; if it's for a productformat (ie product summary rather than product detail) template then adding a src to the template would end up causing the generated html to src it multiple times on the same page.

Simon Barnaby
[email protected]
Web Design, Online Marketing and VPASP addons

Edited by - devshb on April 16 2007 00:26:39
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Snitz Forums 2000