| 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="mailto:u' + 'pgrade@studiop' + 'ress.com?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="mailto:u' + 'pgrade@studiop' + 'ress.com?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
|
|
|