Google Checkout error

Permalink
Hello,

I created a site for a non-profit (http://www.mfkhaiti.org ), and the Google Checkout is giving me a funky error. The Checkout code snipet is currently in an html block on the home page and looks like this:

<div>
<script type="text/javascript">
function validateAmount(amount){
setUrchinInputCode(pageTracker);
if(amount.value.match( /^[0-9]+(\.([0-9]+))?$/)){
return true;
}else{
alert('You must enter a valid donation.');
amount.focus();
return false;
}
}
</script>
<form action="https://checkout.google.com/cws/v2/Donations/549012123696906/checkoutForm" id="BB_BuyButtonForm" method="post" name="BB_BuyButtonForm" onSubmit="return validateAmount(this.item_price_1);">
    <input name="item_name_1" type="hidden" value="Donation to Meds &amp; Food for Kids"/>


The problem is with the javascript alert code at the top. When someone hits the Donate button without entering a dollar amount, it should display an alert window without leaving the homepage. Instead, it takes you to an error page that looks like the attached screen grab.

This little glitch is crucial because people are confused when donating money, and they tend to leave, thinking the site is broken. We checked with a friend at Google, and the error does not seem to be a problem with the code itself.

Any help would be greatly appreciated!

Thanks,
Steve

1 Attachment

srura
 
s2d replied on at Permalink Reply
s2d
Since you didn't mention either way... did you look at the error details provided in the link that is shown in the error message? Any useful clues there?
agedman replied on at Permalink Reply
agedman
I tried setting a breakpoint in Firebug, and the ValidateAmount() function isn't getting called.

You might try calling the validation from an onclick event for the button as discussed here:http://alexking.org/blog/2003/10/01/javascript-onsubmit-handler...