Page 1 of 1
[SOLVED] smarty error when implementing paypal donation form
Posted: Fri Sep 12, 2008 2:06 pm
by aura
please help as i don't know what i'm doing wrong. i'm currently redeveloping a website for a charity and so far i've successfully implemented a 'single donation' form which links directly to the charity's paypal account. however, when i've attempted to implement a 'regular gift' form (for repeat monthly donations) i get the following smarty error at the top of the page:
string(287) "Smarty error: [in content:content_en line 26]: syntax error: unrecognized tag: document.donateform.iarsub15.checked=false;document.donateform.iarsub10.checked=false;document.donateform.iarsub5.checked=false;document.donateform.iarsub3.checked=false; (Smarty_Compiler.class.php, line 446)" string(118) "Smarty error: [in content:content_en line 26]: syntax error: unrecognized tag '' (Smarty_Compiler.class.php, line 590)"
i've noticed that the error only shows up when i copy and paste the code while the wysiwyg option is turned off and then submit the page. however, the form works. if, on the other hand, i switch back to the wysiwyg interface before submitting the page, then the smarty error disappears but i get an error in the form submission!! if i go back and look at the page, i notice that the quotation marks have been converted to " which is probably why it messes things up. (i've also noticed that the smarty error doesn't always appear?!?) help please!
you can view the page here:
http://www.grumpyfrombirth.com/cmsmades ... gular-gift
thank you,
aura.
Re: smarty error when implementing paypal donation form
Posted: Fri Sep 12, 2008 11:50 pm
by Nullig
I don't see a problem with the form.
Nullig
Re: smarty error when implementing paypal donation form
Posted: Sun Sep 14, 2008 3:49 pm
by christiaans
If you could put your template snippet (of the form) here, it'd be very helpful, since then we see if it calls for a non-existing smarty tag perhaps.
Re: smarty error when implementing paypal donation form
Posted: Sun Sep 14, 2008 3:59 pm
by RonnyK
I allways put such logic in a GCB, and have WYSIWYG switched off by default for GCB in Global Settings and User-preferences, to make sure that WYSIWYG doesnt do anything with that....
Then call the GCB in the place you want the form.... Opening a page with logic like this with a WYSIWYG will destroy the logic, so it is better to put this apart from a WYSIWYG area, so the GCB without a WYSIWYG would be a good place.... Otherwise it could be put in the template directly, as there is no WYSIWYG on templates as well...
Ronny
Re: smarty error when implementing paypal donation form
Posted: Mon Sep 15, 2008 8:59 am
by aura
chris-s wrote:
If you could put your template snippet (of the form) here, it'd be very helpful, since then we see if it calls for a non-existing smarty tag perhaps.
this is the code i'm using for the form. i've just checked and i'm still getting the error message
Code: Select all
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_blank" name="donateform">
<p><input type="hidden" name="cmd" value="_ext-enter">
<input type="hidden" name="redirect_cmd" value="_xclick-subscriptions">
<input type="hidden" name="business" value="donations@bdmlr.org.uk">
<input type="hidden" name="return" value="http://www.bdmlr.org.uk/donate/donation-thanks.html">
<input type="hidden" name="image_url" value="http://www.bdmlr.org.uk/donate/bdmlr-paypal-logo.gif">
<input type="hidden" name="item_name" value="BDMLR Subscription">
<input type="hidden" name="no_shipping" value="1">
<input type="hidden" name="rm" value="1">
<input type="hidden" name="cancel_return" value="http://www.bdmlr.org.uk">
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="currency_code" value="GBP">
<input type="hidden" name="p3" value="1">
<input type="hidden" name="t3" value="M">
<input type="hidden" name="src" value="1">
<input type="hidden" name="sra" value="1">
<input type="hidden" name="a3" id="a3" value="">
<input type="hidden" name="custom" value="">
<input type="radio" name="bdmlrsubval" value="15.00" id="iarsub15" onClick='document.donateform.amountsubtxt.value="";document.donateform.a3.value="15.00";'> £15
<input type="radio" name="bdmlrsubval" value="10.00" id="iarsub10" onClick='document.donateform.amountsubtxt.value="";document.donateform.a3.value="10.00";'> £10
<input type="radio" name="bdmlrsubval" value="5.00" id="iarsub5" onClick='document.donateform.amountsubtxt.value="";document.donateform.a3.value="5.00";'> £5
<input type="radio" name="bdmlrsubval" value="3.00" id="iarsub3" onClick='document.donateform.amountsubtxt.value="";document.donateform.a3.value="3.00";'> £3
<input type="text" class="content" name="amountsubtxt" id="amountsubtxt" value="" size="7" maxlength="7" onClick='document.donateform.iarsub15.checked=false;document.donateform.iarsub10.checked=false;document.donateform.iarsub5.checked=false;document.donateform.iarsub3.checked=false;document.donateform.amountsubtxt.value="";' onChange='if(document.donateform.amountsubtxt.value!="") ;document.donateform.a3.value=document.donateform.amountsubtxt.value;'> Other</p>
<p><em>(For 'other', please type in your chosen amount)</em></p>
<p><strong>GiftAid:</strong>
<input type="hidden" name="on0" value="giftaid">
<input type="radio" name="os0" value="yes" checked> Yes
<input type="radio" name="os0" value="no"> No
<em>(If you are a UK tax payer, please select 'Yes')</em></p>
<p><strong>Please enter your contact details below:</strong></p>
<table border="0" cellpadding="0" cellspacing="4" class="form">
<tr>
<td>First Name: </td>
<td><input type="text" name="first_name" value="" size="40" maxlength="40"></td>
</tr>
<tr>
<td>Last Name: </td>
<td><input type="text" name="last_name" value="" size="40" maxlength="40"></td>
</tr>
<tr>
<td>Email: </td>
<td><input type="text" name="email" value="" size="40" maxlength="40"></td>
</tr>
<tr>
<td>Address: </td>
<td><input type="text" name="address1" value="" size="40" maxlength="40"></td>
</tr>
<tr>
<td> </td>
<td><input type="text" name="address2" value="" size="40" maxlength="40"></td>
</tr>
<tr>
<td>Town/City: </td>
<td><input type="text" name="city" value="" size="40" maxlength="40"></td>
</tr>
<tr>
<td>County/Province: </td>
<td><input type="text" name="state" value="" size="20" maxlength="30"></td>
</tr>
<tr>
<td>Postal Code:</td>
<td><input type="text" name="zip" value="" size="20" maxlength="10"></td>
</tr>
<tr>
<td>Country: </td>
<td>
<select name="country">
<option value="" selected>Please choose...
<option value="">---
<option value="GB">United Kingdom
<option value="">---
<option value="AI">Anguilla
<option value="AR">Argentina
<option value="AU">Australia
<option value="AT">Austria
<option value="BE">Belgium
<option value="BR">Brazil
<option value="CA">Canada
<option value="CL">Chile
<option value="CN">China
<option value="CR">Costa Rica
<option value="DK">Denmark
<option value="DO">Dominican Republic
<option value="EC">Ecuador
<option value="FI">Finland
<option value="FR">France
<option value="DE">Germany
<option value="GR">Greece
<option value="HK">Hong Kong
<option value="IS">Iceland
<option value="IN">India
<option value="IE">Ireland
<option value="IL">Israel
<option value="IT">Italy
<option value="JM">Jamaica
<option value="JP">Japan
<option value="LU">Luxembourg
<option value="MY">Malaysia
<option value="MX">Mexico
<option value="MC">Monaco
<option value="NL">Netherlands
<option value="NZ">New Zealand
<option value="NO">Norway
<option value="PT">Portugal
<option value="SG">Singapore
<option value="KR">South Korea
<option value="ES">Spain
<option value="SE">Sweden
<option value="CH">Switzerland
<option value="TH">Thailand
<option value="TW">Taiwan
<option value="TR">Turkey
<option value="GB">United Kingdom
<option value="US">United States
<option value="UY">Uruguay
<option value="VE">Venezuela
<option value="">Other...
</select>
</td>
</tr>
<tr>
<td><input type="image" src="https://www.paypal.com/images/x-click-butcc-subscribe.gif" border="0" name="submit" alt="Donate with PayPal - it's fast, free and secure!" align="left" valign="middle" onClick="document.donateform.custom.value='Address: ' + document.donateform.address1.value + ', ' + document.donateform.address2.value + ', ' + document.donateform.city.value + ', ' + document.donateform.state.value + ', ' + document.donateform.zip.value + ', ' + document.donateform.country.value;">
</td>
<td><em>Your payment will appear as 'British Divers Marine Life Rescue'.</em></td>
</tr>
</table>
</form>
Re: smarty error when implementing paypal donation form
Posted: Mon Sep 15, 2008 8:59 am
by aura
RonnyK wrote:
I allways put such logic in a GCB, and have WYSIWYG switched off by default for GCB in Global Settings and User-preferences, to make sure that WYSIWYG doesnt do anything with that....
Then call the GCB in the place you want the form.... Opening a page with logic like this with a WYSIWYG will destroy the logic, so it is better to put this apart from a WYSIWYG area, so the GCB without a WYSIWYG would be a good place.... Otherwise it could be put in the template directly, as there is no WYSIWYG on templates as well...
Ronny
thanks ronny -- will give it a try now. makes sense.
Re: smarty error when implementing paypal donation form
Posted: Mon Sep 15, 2008 9:10 am
by aura
ronny's suggestion appears to have done the trick! thank you again so much.
aura.