Index: branches/fundraising/extensions/DonationInterface/donate_interface/validate_donation.js |
— | — | @@ -1,54 +0,0 @@ |
2 | | -//<![CDATA[ |
3 | | -function validateForm( form ) { |
4 | | - |
5 | | - var minimums = { |
6 | | - 'USD' : 1, |
7 | | - 'GBP' : 1, // $1.26 |
8 | | - 'EUR' : 1, // $1.26 |
9 | | - 'AUD' : 2, // $1.35 |
10 | | - 'CAD' : 1, // $0.84 |
11 | | - 'CHF' : 1, // $0.85 |
12 | | - 'CZK' : 20, // $1.03 |
13 | | - 'DKK' : 5, // $0.85 |
14 | | - 'HKD' : 10, // $1.29 |
15 | | - 'HUF' : 200, // $0.97 |
16 | | - 'JPY' : 100, // $1 |
17 | | - 'NZD' : 2, // $1.18 |
18 | | - 'NOK' : 10, // $1.44 |
19 | | - 'PLN' : 5, // $1.78 |
20 | | - 'SGD' : 2, // $1.35 |
21 | | - 'SEK' : 10, // $1.28 |
22 | | - }; |
23 | | - |
24 | | - var error = true; |
25 | | - |
26 | | - // Get amount selection |
27 | | - var amount = null; |
28 | | - for ( var i = 0; i < form.amount.length; i++ ) { |
29 | | - if ( form.amount[i].checked ) { |
30 | | - amount = form.amount[i].value; |
31 | | - } |
32 | | - } |
33 | | - if ( form.amount2.value != '' ) { |
34 | | - amount = form.amount2.value; |
35 | | - } |
36 | | - // Check amount is a real number |
37 | | - error = ( amount == null || isNaN( amount ) || amount.value <= 0 ); |
38 | | - if ( error ) { |
39 | | - alert( 'You must enter a valid amount.' ); |
40 | | - } |
41 | | - |
42 | | - // Check amount is at least the minimum |
43 | | - var currency = form.currency_code[form.currency_code.selectedIndex].value; |
44 | | - if ( typeof( minimums[currency] ) == 'undefined' ) { |
45 | | - minimums[currency] = 1; |
46 | | - } |
47 | | - |
48 | | - if ( amount < minimums[currency] ) { |
49 | | - alert( 'You must contribute at least $1'.replace('$1', minimums[currency] + ' ' + currency ) ); |
50 | | - error = true; |
51 | | - } |
52 | | - |
53 | | - return !error; |
54 | | -} |
55 | | -//]]> |
\ No newline at end of file |
Index: branches/fundraising/extensions/DonationInterface/donate_interface/donate_interface_validate_donation.js |
— | — | @@ -1,53 +0,0 @@ |
2 | | -//<![CDATA[ |
3 | | -function DonateValidateForm( form ) { |
4 | | - |
5 | | - var minimums = { |
6 | | - 'USD' : 1, |
7 | | - 'GBP' : 1, // $1.26 |
8 | | - 'EUR' : 1, // $1.26 |
9 | | - 'AUD' : 2, // $1.35 |
10 | | - 'CAD' : 1, // $0.84 |
11 | | - 'CHF' : 1, // $0.85 |
12 | | - 'CZK' : 20, // $1.03 |
13 | | - 'DKK' : 5, // $0.85 |
14 | | - 'HKD' : 10, // $1.29 |
15 | | - 'HUF' : 200, // $0.97 |
16 | | - 'JPY' : 100, // $1 |
17 | | - 'NZD' : 2, // $1.18 |
18 | | - 'NOK' : 10, // $1.44 |
19 | | - 'PLN' : 5, // $1.78 |
20 | | - 'SGD' : 2, // $1.35 |
21 | | - 'SEK' : 10, // $1.28 |
22 | | - }; |
23 | | - |
24 | | - var error = true; |
25 | | - |
26 | | - // Get amount selection |
27 | | - var amount = null; |
28 | | - for ( var i = 0; i < form.amount.length; i++ ) { |
29 | | - if ( form.amount[i].checked ) { |
30 | | - amount = form.amount[i].value; |
31 | | - } |
32 | | - } |
33 | | - if ( form.amount2.value != "" ) { |
34 | | - amount = form.amount2.value; |
35 | | - } |
36 | | - // Check amount is a real number |
37 | | - error = ( amount == null || isNaN( amount ) || amount.value <= 0 ); |
38 | | - if ( error ) { |
39 | | - alert( 'You must enter a valid amount.' ); |
40 | | - } |
41 | | - |
42 | | - // Check amount is at least the minimum |
43 | | - var currency = form.currency_code[form.currency_code.selectedIndex].value; |
44 | | - if ( typeof( minimums[currency] ) == 'undefined' ) { |
45 | | - minimums[currency] = 1; |
46 | | - } |
47 | | - if ( amount < minimums[currency] ) { |
48 | | - alert( 'You must contribute at least $1'.replace('$1', minimums[currency] + ' ' + currency ) ); |
49 | | - error = true; |
50 | | - } |
51 | | - |
52 | | - return !error; |
53 | | -} |
54 | | -//]]> |