Here's what I'm trying to do:
User wants to purchase a coupon.
There is a limit to the total number of coupons available.
If the user intends to purchase more than the remaining number of coupons, display an error message and user ends up back at the form to try a smaller amount for purchase.
If the user intends to purchase coupons and there are still enough remaining coupons, redirect the user to PayPal for purchase.
I have a very simple form and I'm using the Redirect Plugin for getting to PayPal.
This is working very well.
Now, I need to put in the code that calculates whether or not the number of coupons the user requests are available.
As a simple test, I followed http://www.chronoengine.com/forums.html?cont=posts&f=2&t=11560&p=17018#p17018 and made a simple test:
On the form General tab: Form tag attachment: onSubmit="return Validate()"
On the form Form Code, Form Javascript:
I had expected the alert message to pop, but it did not.
Instead the redirect to PayPal happened.
How can I perform the check on number of coupons requested before redirecting to PayPal?
User wants to purchase a coupon.
There is a limit to the total number of coupons available.
If the user intends to purchase more than the remaining number of coupons, display an error message and user ends up back at the form to try a smaller amount for purchase.
If the user intends to purchase coupons and there are still enough remaining coupons, redirect the user to PayPal for purchase.
I have a very simple form and I'm using the Redirect Plugin for getting to PayPal.
This is working very well.
Now, I need to put in the code that calculates whether or not the number of coupons the user requests are available.
As a simple test, I followed http://www.chronoengine.com/forums.html?cont=posts&f=2&t=11560&p=17018#p17018 and made a simple test:
On the form General tab: Form tag attachment: onSubmit="return Validate()"
On the form Form Code, Form Javascript:
function Validate(){
if(1 != 2){
alert('Your passwords do not match');
return false;
}else{
return true;
}
}
I had expected the alert message to pop, but it did not.
Instead the redirect to PayPal happened.
How can I perform the check on number of coupons requested before redirecting to PayPal?