homepage Welcome to WebmasterWorld Guest from 50.16.165.62
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

    
Help w/a bit of Javascript
Help solve this problem
Craiger




msg:3958445
 9:45 pm on Jul 23, 2009 (gmt 0)

I am trying to get pass 2 variables that were set in javascript to an emailto setup.

The page is created from two templates.

Here is the code the first template:

<script type="text/javascript">
var item = "[%item_name%]";
var maxdl = "[%max_downloads%]";
var dwnld = "[%downloads%]";
var price = "[%sale_price%]";
</script>

Here is the problem code for the second template:

<p>2. Send an email by
<script>document.write('<a href="&#x6d;&#97;&#105;&#108;&#x74;&#x6f;&#x3a;&#x75;' +
'&#112;&#x67;&#x72;&#97;&#x64;&#101;&#x40;&#x73;&#116;&#x75;&#x64;&#105;&#x6f;&#112;' +
'&#114;&#101;&#x73;&#x73;&#x2e;&#99;&#x6f;&#109;?subject=Forum User Account Upgrade ' +
'Request&body=ENTER Your SUPPORT FORUM USER ID Here: %0A%0A
[%first_name%] [%last_name%] %0A
[%payer_email%] %0A
[%txn_id%] %0A'+item+' %0A '+price+' %0A
[%p_date%] %0A">CLICKING HERE</a>')</script>* and be sure to
<b>include your Support Forum ID</b></p>
<p>* If your email program does not support the Information Pre-fill,
then include the following:</p>
<p>
<ul>
<li>1. The <b>Support Forum User ID</b> you registered with</li>
<li>2. <b>Copy & Paste the following</b> into your email:
<ul><li>Forum User ID: </li>
<li>[%first_name%] [%last_name%]</li>
<li>[%payer_email%]</li>
<li>[%txn_id%]</li>
<li><script>document.write(item)</script></li>
<li><script>document.write(price)</script></li>
<li>[%p_date%]</li>
</ul></li></ul>
</p>

Here is what the source code looks like:

<script type="text/javascript">
var item = "Lifestyle WordPress Theme";
var maxdl = "5";
var dwnld = "0";
var price = "0.00";
</script>
</div>
<p>2. Send an email by
<script>document.write('<a href="&#x6d;&#97;&#105;&#108;&#x74;&#x6f;&#x3a;&#x75;' +
'&#112;&#x67;&#x72;&#97;&#x64;&#101;&#x40;&#x73;&#116;&#x75;&#x64;&#105;&#x6f;&#112;' +
'&#114;&#101;&#x73;&#x73;&#x2e;&#99;&#x6f;&#109;?subject=Forum User Account Upgrade ' +
'Request&body=ENTER Your SUPPORT FORUM USER ID Here: %0A%0A
Craig tuller %0A
example@example.com %0A
j-kn8jko4f7d9716c %0A'+item+' %0A '+price+' %0A
December 31, 1969 %0A ">CLICKING HERE</a>')</script>* and be sure to <b>include your Support Forum ID</b></p>
<p>* If your email program does not support the Information Pre-fill, then include the following:</p>

Any help would greatly be appreciated!

[edited by: DrDoc at 4:11 pm (utc) on July 24, 2009]
[edit reason] examplified e-mail, removed side-scroll [/edit]

 

DrDoc




msg:3959019
 4:13 pm on Jul 24, 2009 (gmt 0)

Welcome to WebmasterWorld!

Here is the problem code for the second template

What exactly is the problem? Presumably the data doesn't get passed due to the linebreaks.

Craiger




msg:3960705
 1:57 am on Jul 28, 2009 (gmt 0)

item & price do not display on the email form, but do display on the web page.

So this: [%txn_id%] %0A'+item+' %0A '+price+' %0A
does not work for item & price

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved