Index: trunk/extensions/DonationInterface/payflowpro_gateway/forms/html/TwoStepTwoColumnLetter3-legal.html |
— | — | @@ -1,11 +1,11 @@ |
2 | 2 | <script type="text/javascript"> |
3 | 3 | mw.loader.load('pfp.form.rapidhtml.TwoStepTwoColumnLetter3'); |
4 | 4 | // these must go through RapidHTML and thus are inline |
5 | | -// var amountErrors = ['#general|escape','#retryMsg|escape','#amount|escape']; |
6 | | -// var billingErrors = ['#fname|escape','#lname|escape','#city|escape','#country|escape','#street|escape','#state|escape','#zip|escape','#emailAdd|escape']; |
7 | | -// var paymentErrors = ['#card_num|escape','#card_type|escape','#cvv|escape']; |
8 | | -// var actionURL = "@action"; |
9 | | -// var scriptPath = "@script_path"; |
| 5 | + var amountErrors = ['#general|escape','#retryMsg|escape','#amount|escape']; |
| 6 | + var billingErrors = ['#fname|escape','#lname|escape','#city|escape','#country|escape','#street|escape','#state|escape','#zip|escape','#emailAdd|escape']; |
| 7 | + var paymentErrors = ['#card_num|escape','#card_type|escape','#cvv|escape']; |
| 8 | + var actionURL = "@action"; |
| 9 | + var scriptPath = "@script_path"; |
10 | 10 | </script> |
11 | 11 | |
12 | 12 | <table width="100%" cellspacing="0" cellpadding="0" border="0"> |
— | — | @@ -21,6 +21,7 @@ |
22 | 22 | <p id="noscript-msg">It appears that you do not have JavaScript enabled, or your browser does not support it. In order to provide a safe, secure and pleasant experience, our donation form requires JavaScript.</p><p id="noscript-redirect-msg">If you cannot or do not wish to enable JavaScript, you may still contribute by visiting:</p><p id="noscript-redirect-link"><a href="http://wikimediafoundation.org/wiki/DonateNonJS/en">http://wikimediafoundation.org/wiki/DonateNonJS/en</a></p> |
23 | 23 | </div> |
24 | 24 | </noscript> |
| 25 | + |
25 | 26 | <h2 id="donate-head">Please complete your donation below ...</h2> |
26 | 27 | |
27 | 28 | <p id="topError" class="creditcard-error-msg"></p> |
Index: trunk/extensions/DonationInterface/payflowpro_gateway/forms/js/TwoStepTwoColumnLetter3.js |
— | — | @@ -41,12 +41,14 @@ |
42 | 42 | } |
43 | 43 | |
44 | 44 | $( "#ccSubmitButton" ).click( function() { |
45 | | - // Safety check for people who hit the back button |
46 | | - checkedValue = $( "input[name='amountRadio']:checked" ).val(); |
47 | | - currenctAmount = $( 'input[name="amount"]' ).val(); |
48 | | - // The currenctAmount could be set to empty string or '0.00' |
49 | | - if ( ( currentAmount == '0.00' || currentAmount == '' ) && checkedValue && !isNaN( checkedValue ) ) { |
50 | | - $( 'input[name="amount"]' ).val( checkedValue ); |
| 45 | + // Safety check for people who hit the back button on forms with amount radio buttons |
| 46 | + if ( $( "input[name='amountRadio']" ).length { |
| 47 | + checkedValue = $( "input[name='amountRadio']:checked" ).val(); |
| 48 | + currentAmount = $( 'input[name="amount"]' ).val(); |
| 49 | + // The currenctAmount could be set to empty string or '0.00' |
| 50 | + if ( ( currentAmount == '0.00' || currentAmount == '' ) && checkedValue && !isNaN( checkedValue ) ) { |
| 51 | + $( 'input[name="amount"]' ).val( checkedValue ); |
| 52 | + } |
51 | 53 | } |
52 | 54 | if ( validateAmount() ) { |
53 | 55 | if ( validate_form() ) { |