Welcome to WebmasterWorld Guest from 54.147.250.33

Forum Moderators: open

Help w/a bit of Javascript

Help solve this problem

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

5+ Year Member



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]

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

WebmasterWorld Senior Member drdoc is a WebmasterWorld Top Contributor of All Time 10+ Year Member



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.

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

5+ Year Member



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

 

Featured Threads

Hot Threads This Week

Hot Threads This Month