[thelist] I agree to terms with a PayPal button

Mark Groen evolt at markgroen.com
Fri Jan 14 11:30:06 CST 2011


On 2011-01-14 7:10 AM, Bob Meetin wrote:
> Administrative HQ wrote:
>> We've used this free code with a PayPal button:
>>
>> http://www.dynamicdrive.com/dynamicindex16/acceptterm.htm
>>
>> David
>>
>> ------------------------------------------------------------------------
>> *From:* Bob Meetin <bobm at dottedi.biz>
>> *To:* "thelist at lists.evolt.org" <thelist at lists.evolt.org>
>> *Sent:* Thu, January 13, 2011 5:23:27 PM
>> *Subject:* [thelist] I agree to terms with a PayPal button
>>
>> http://dottedi.biz/code/agree_with_paypal.html
>>
>> I got the I agree and checkbox code from a google search.  However, 
>> it needs to work with a paypal/similar button as opposed to a submit 
>> button.  How do you make it work to deactivate paypal until the 
>> checkbox is checked?
> This is the same code that I grabbed and tested yesterday.  Again the 
> problem is that I don't know how to modify it so that it grays out the 
> PayPal button rather than a submit button.  What Mark emailed back 
> was/is door #2.  I'm sure that I can redirect to a page with a paypal 
> button, but not sure how to redirect directly to paypal.  I don't want 
> to force the buyer to go through an extraneous extra page if 
> avoidable. Maybe a variation of what Mark suggested is  the solution.  
> I'm sure there's an ajaxy way to expose a hidden field once you've 
> clicked on "I agree" as well.

If you really want to do this with javascript...

Looking at the agree_with_paypal.htmlpage source, see that you have 
created two forms - they should be combined into one form. Also, here's 
an alternate code snippet, think you may be hung up on trying to grey 
out the superfluous button. Not tested, but should give you enough of an 
idea:

function checkCheckBox(f){
if (f.agree.checked == false )
{
alert('Please read/accept terms to submit form');
return false;
}else
return true;
}


<formaction="https://www.paypal.com/cgi-bin/webscr" method="post" 
onsubmit="return checkCheckBox(this)">
<input type="checkbox" value="0" name="agree"><b> I agree to the above 
terms</b>

<inputtype="hidden" name="cmd" value="_s-xclick">
<inputtype="hidden" name="hosted_button_id" value="8NGJU6BFETY32">
<inputtype="image" 
src="https://www.paypal.com/en_US/i/btn/btn_paynowCC_LG.gif 
<view-source:https://www.paypal.com/en_US/i/btn/btn_paynowCC_LG.gif>" 
border="0" name="submit" alt="PayPal - The safer, easier way to pay 
online!"><imgalt="" border="0" 
src="https://www.paypal.com/en_US/i/scr/pixel.gif 
<view-source:https://www.paypal.com/en_US/i/scr/pixel.gif>" width="1" 
height="1">
</form>

cheers,

     Mark
--






More information about the thelist mailing list