Products

Solutions

Resources

Partners

Community

Blog

About

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...PayPal code not workingPayPal code not working
Previous
 
Next
New Post
5/11/2019 9:02 AM
 
I've added the PayPal code to the site I'm working on but when I click on the Buy Now or Donate button it doesn't go anywhere. 
 
New Post
5/11/2019 2:46 PM
 
I have not done this in ages, but if I remember correctly it is because paypal code does not use javascript to handle the button click. And Since the whole Dnn website is a form, then pressing that button posts back to your site instead of to paypal.

Workaround:
As we cannot nest forms, in your paypal code, you need to remove the opening and closing form tags.
Then change the button so that it modifies the form post url and then submits the form instead of just submitting normally. In your button, create an onClick property like this

onClick="this.form.action='https//www.paypal.com/.......';this.form.submit();"

replace ...... by whatever was in the original form tag for the url (I do not rememeber the specifics.


Note: This is what I remember from many years ago, not sure if paypal forms are still like that, if not, give us a code sample please.

 
New Post
5/12/2019 8:30 AM
 
Thanks for your help.  Here is the code for one of the buttons:

<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top"><input name="cmd" type="hidden" value="_s-xclick" /> <input name="hosted_button_id" type="hidden" value="HGMP67LJD8GNY" /> <input alt="Donate with PayPal button" border="0" name="submit" src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif" title="PayPal - The safer, easier way to pay online!" type="image" /> <img alt="" border="0" height="1" src="https://www.paypal.com/en_CA/i/scr/pixel.gif" width="1" /></form>

 
New Post
5/13/2019 4:45 PM
 

Awesome, thanks for the code sample, so that would need to become:

<input name="cmd" type="hidden" value="_s-xclick" />
<input name="hosted_button_id" type="hidden" value="HGMP67LJD8GNY" />
<input alt="Donate with PayPal button" border="0"
name="submit" src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif"
title="PayPal - The safer, easier way to pay online!"
type="image"
onclick="this.form.action='https://www.paypal.com/cgi-bin/webscr';this.form.submit();"
/>
<img alt="" border="0" height="1" src="https://www.paypal.com/en_CA/i/scr/pixel.gif" width="1" />
 
New Post
5/14/2019 7:38 AM
 
Thank you .  That worked.  I have another code too.  How do I change this one:

<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top"><input name="cmd" type="hidden" value="_s-xclick" /> <input name="hosted_button_id" type="hidden" value="G8LXNQ37DHM2W" />
<table>
 <tbody>
  <tr>
   <td><input name="on0" type="hidden" value="Option" />Option</td>
  </tr>
  <tr>
   <td><select name="os0"><option value="180 Club">180 Club $180.00 CAD</option><option value="Diamond Jubilee Supporter">Diamond Jubilee Supporter $75.00 CAD</option> </select></td>
  </tr>
  <tr>
   <td><input name="on1" type="hidden" value="Member's Full Name" />Member&#39;s Full Name</td>
  </tr>
  <tr>
   <td><input maxlength="200" name="os1" type="text" /></td>
  </tr>
 </tbody>
</table>
<input name="currency_code" type="hidden" value="CAD" /> <input alt="PayPal - The safer, easier way to pay online!" border="0" name="submit" src="https://www.paypalobjects.com/en_US/i/btn/btn_paynow_LG.gif" type="image" /> <img alt="" border="0" height="1" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" /></form>



 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...PayPal code not workingPayPal code not working


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out