Jump to content


Photo

Form for subscriptions not working... help please?


  • This topic is locked This topic is locked
No replies to this topic

#1 Ken Ross

Ken Ross

    Newbie

  • Members
  • Pip
  • 1 posts

Posted 16 December 2005 - 12:35 AM

I am using the following code in a web form to dynamically generate a subscription. It seems to be posting the information correctly to me, but Paypal is returning an error:

"The link you have used to enter the PayPal system is invalid. Please review the link and try again."

I am not sure if I do or do not have errors in the form or javascript, or if the problem is something else. Any help you can provide is appreciated!


<head>
<script language="JavaScript" type="text/javascript">
<!--
var AmountAry=new Array();
AmountAry[0]=['20','Monthly','1','M'];
AmountAry[1]=['125','Monthly','1','M'];
AmountAry[2]=['225','Monthly','1','M'];
AmountAry[3]=['300','Monthly','1','M'];
AmountAry[4]=['400','Monthly','1','M'];
AmountAry[5]=['780','Quarterly','3','M'];
AmountAry[6]=['1170','Quarterly','3','M'];
AmountAry[7]=['1520','Quarterly','3','M'];
AmountAry[8]=['1900','Quarterly','3','M'];
AmountAry[9]=['2220','Quarterly','3','M'];
AmountAry[10]=['2775','Quarterly','3','M'];
AmountAry[11]=['3600','Yearly','1','Y'];
AmountAry[12]=['4375','Yearly','1','Y'];
AmountAry[13]=['5100','Yearly','1','Y'];
AmountAry[14]=['5775','Yearly','1','Y'];
AmountAry[15]=['6400','Yearly','1','Y'];
AmountAry[16]=['6975','Yearly','1','Y'];
AmountAry[16]=['7500','Yearly','1','Y'];

var P3,T3;

function Populate(){
obj=document.getElementById('Amount')
txt='';
for (zxc0=0;zxc0<AmountAry.length;zxc0++){
if (!txt.match(AmountAry[zxc0][0])){
obj.options[obj.options.length]=new Option('$'+AmountAry[zxc0][0],AmountAry[zxc0][1],true,true);
txt+=AmountAry[zxc0][0]+',';
}
}
obj.selectedIndex=0;
obj=document.getElementById('Period')
txt='';
for (zxc1=0;zxc1<AmountAry.length;zxc1++){
if (!txt.match(AmountAry[zxc1][1])){
obj.options[obj.options.length]=new Option(AmountAry[zxc1][1],'',true,true);
obj.options[obj.options.length-1].ary=AmountAry[zxc1];
txt+=AmountAry[zxc1][1]+',';
}
}
obj.selectedIndex=0;
}

function Change(obj){
obj1=document.getElementById('Amount')
obj2=document.getElementById('Period')
P3=null; T3=null;
if (obj==obj1){
obj2.style.visibility='hidden';
if (obj1.selectedIndex>0){
for (zxc0=0;zxc0<obj2.options.length;zxc0++){
if (obj2.options[zxc0].text==obj1.options[obj1.selectedIndex].value){
obj2.selectedIndex=zxc0;
}
}
obj2.style.visibility='visible';
}
}
P3=obj2.options[obj2.selectedIndex].ary[2]
T3=obj2.options[obj2.selectedIndex].ary[3]
document.getElementById('P3TB').value=P3;
document.getElementById('T3TB').value=T3;
}
//-->
</script>
</head>
<body onload="Populate();">

<form name="_xclick" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_xclick-subscriptions">
<input type="hidden" name="business" value="xxx@xxx.com">

<select name="a3" id="Amount" onchange="Change(this);">
<option value="" >Select Amount</option>
</select>

<select id="Period" onchange="Change(this);" style="visibility:hidden;" >
<option value="" >Select Period</option>
</select>

<input type="hidden" name="t3" id="T3TB">
<input type="hidden" name="p3" id="P3TB">
<input type="hidden" name="src" value="1">
<input type="hidden" name="sra" value="1">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="no_shipping" value="1">

<input type="image" src="http://www.paypal.com/en_US/i/btn/x-click-but20.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">

</form>
</body>






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users