I have two stories that have PayPal buttons at the bottom. They are simply form submit buttons that link to PayPal's site and fill in a few fields with the necessary info (the email address, description of what you're paying for, etc.) Here is the code I'm using for the button:


<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="image" src="http://www.tzpikes.com/graphics/donate.png" border="0" name="submit" alt="Donate Now">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="payments@tzpikes.com">
<input type="hidden" name="item_name" value="Donation">
<input type="hidden" name="no_shipping" value="0">
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="tax" value="0">
<input type="hidden" name="lc" value="US">
<input type="hidden" name="bn" value="PP-DonationsBF">
<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>

When you press this button in the node, it works as expected. However, when you click the button on the front page (the teaser version), it takes you to Paypal, but not all the necessary info is filled in, it's blank. The post settings are for full HTML. I thought the problem was that my trim settings cut off some of the code, perhaps, but I changed my trim settings to unlimited, and the same thing happens. It's really weird that the button would behave differently in the teaser view.

Any ideas?

Comments

anonymous562’s picture

Sorry, the address is http://www.tzpikes.com/pikeaccess

vm’s picture

try settiing a <!--break--> at the end of your node and resubmit. Which forces the teaser to be the full node. Worth a shot. Although this may have the same effect as setting your node length to unlimited.

dman’s picture

Yes, it's the teaser trimming problem.
You could try squeezing all that form data into a GET URL - no reason that shouldn't work but yes, setting it to manual or using the break tag is a tidy solution.
Setting the length to unlimited may not take effect immediately. You need to open and save the nodes themselves for the new teaser to be generated. YMMV depending on caching.

.dan.
How to troubleshoot Drupal | http://www.coders.co.nz/

anonymous562’s picture

Thanks for the tips! They worked. The only problem now is that with all these hidden fields, they create a bunch of blank lines, so there are about 6-7 empty lines before the next teaser appears. Dman, you mentioned something about a Get URL -- are you talking about geturl.org? I don't know how to pass those values onto something like that, because when you go to the page, the address doesn't have all those variables listed out like that.

Any ideas on how I can fix this? You can see what I mean at the site http://www.tzpikes.com/pikeaccess.

dman’s picture

The newlines are coming from the newlines you entered - as you have the paragraph-break converter turned on.
Remove the returns from your source - it'll look ugly - and that'll go away.
Or save as PHP code - which is not the greatest approach.

When I said GET URL, I mean the alternative syntax to POST. Your form could maybe work just as well if you instead create a LINK of the form
[a href="https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=payments@tzpi... .... "]Donate![/a]
adding all those values to one big URL as required. ... However it's possible that the secure server on the recieving end will not listen to that. For a couple of reasons. Depends how it's coded. Worth a crack however.

.dan.
How to troubleshoot Drupal | http://www.coders.co.nz/

anonymous562’s picture

Excellent--I didn't even think about the paragraph breaks. I removed those, and all is well. I really appreciate the help!