Index: trunk/extensions/DonationInterface/payflowpro_gateway/form_placeholders.js |
— | — | @@ -32,14 +32,24 @@ |
33 | 33 | if (document.getElementById('lname').value == mw.msg( 'donate_interface-donor-lname' )) { |
34 | 34 | output += mw.msg( 'donate_interface-error-msg-js' ) + ' last name.\r\n'; |
35 | 35 | } |
| 36 | + |
36 | 37 | var stateField = document.getElementById( 'state' ); |
37 | | - var stateFieldSelected = stateField.options[stateField.selectedIndex].value; |
38 | | - if( stateFieldSelected == '' || stateFieldSelected == 'YY' ) { |
39 | | - output += mw.msg( 'donate_interface-error-msg-js' ) + ' ' + mw.msg( 'donate_interface-state-province' ) + '.\r\n'; |
| 38 | + if ( stateField && stateField.type == 'select-one' ) { // state is a dropdown select |
| 39 | + var selectedState = stateField.options[stateField.selectedIndex].value; |
| 40 | + if ( selectedState == 'YY' || selectedState == '' ) { |
| 41 | + output += mw.msg( 'donate_interface-error-msg-js' ) + ' ' + mw.msg( 'donate_interface-state-province' ) + '.\r\n'; |
| 42 | + } |
40 | 43 | } |
| 44 | + |
41 | 45 | var countryField = document.getElementById( 'country' ); |
42 | | - if( countryField.options[countryField.selectedIndex].value == '' ) { |
43 | | - output += mw.msg( 'donate_interface-error-msg-js' ) + ' ' + mw.msg( 'donate_interface-error-msg-country' ) + '.\r\n'; |
| 46 | + if ( countryField && countryField.type == 'select-one' ) { // country is a dropdown select |
| 47 | + if ( countryField.options[countryField.selectedIndex].value == '' ) { |
| 48 | + output += mw.msg( 'donate_interface-error-msg-js' ) + ' ' + mw.msg( 'donate_interface-error-msg-country' ) + '.\r\n'; |
| 49 | + } |
| 50 | + } else { // country is a hidden or text input |
| 51 | + if ( countryField.value == '' ) { |
| 52 | + output += mw.msg( 'donate_interface-error-msg-js' ) + ' ' + mw.msg( 'donate_interface-error-msg-country' ) + '.\r\n'; |
| 53 | + } |
44 | 54 | } |
45 | 55 | |
46 | 56 | // validate email address |
— | — | @@ -47,9 +57,17 @@ |
48 | 58 | var dotpos = document.payment.emailAdd.value.lastIndexOf("."); |
49 | 59 | |
50 | 60 | if( apos < 1 || dotpos-apos < 2 ) { |
51 | | - output += mw.msg( 'donate_interface-error-msg-email' ); |
| 61 | + output += mw.msg( 'donate_interface-error-msg-email' ) + '.\r\n'; |
52 | 62 | } |
53 | 63 | |
| 64 | + // Make sure cookies are enabled |
| 65 | + document.cookie = 'wmf_test=1;'; |
| 66 | + if ( document.cookie.indexOf( 'wmf_test=1' ) != -1 ) { |
| 67 | + document.cookie = 'wmf_test=; expires=Thu, 01-Jan-70 00:00:01 GMT;'; // unset the cookie |
| 68 | + } else { |
| 69 | + output += mw.msg( 'donate_interface-error-msg-cookies' ); // display error |
| 70 | + } |
| 71 | + |
54 | 72 | if( output ) { |
55 | 73 | alert( output ); |
56 | 74 | return false; |
Index: trunk/extensions/DonationInterface/gateway_forms/rapidhtml/html/globalcollect_test.html |
— | — | @@ -47,9 +47,17 @@ |
48 | 48 | var dotpos = document.payment.emailAdd.value.lastIndexOf("."); |
49 | 49 | |
50 | 50 | if( apos < 1 || dotpos-apos < 2 ) { |
51 | | - output += mw.msg( 'donate_interface-error-msg-email' ); |
| 51 | + output += mw.msg( 'donate_interface-error-msg-email' ) + '.\r\n'; |
52 | 52 | } |
53 | 53 | |
| 54 | + // Make sure cookies are enabled |
| 55 | + document.cookie = 'wmf_test=1;'; |
| 56 | + if ( document.cookie.indexOf( 'wmf_test=1' ) != -1 ) { |
| 57 | + document.cookie = 'wmf_test=; expires=Thu, 01-Jan-70 00:00:01 GMT;'; // unset the cookie |
| 58 | + } else { |
| 59 | + output += mw.msg( 'donate_interface-error-msg-cookies' ); // display error |
| 60 | + } |
| 61 | + |
54 | 62 | if( output ) { |
55 | 63 | alert( output ); |
56 | 64 | return false; |
Index: trunk/extensions/DonationInterface/gateway_forms/rapidhtml/js/globalcollect_test_2.js |
— | — | @@ -63,9 +63,17 @@ |
64 | 64 | var dotpos = document.payment.emailAdd.value.lastIndexOf("."); |
65 | 65 | |
66 | 66 | if( apos < 1 || dotpos-apos < 2 ) { |
67 | | - output += mw.msg( 'donate_interface-error-msg-email' ); |
| 67 | + output += mw.msg( 'donate_interface-error-msg-email' ) + '.\r\n'; |
68 | 68 | } |
69 | 69 | |
| 70 | + // Make sure cookies are enabled |
| 71 | + document.cookie = 'wmf_test=1;'; |
| 72 | + if ( document.cookie.indexOf( 'wmf_test=1' ) != -1 ) { |
| 73 | + document.cookie = 'wmf_test=; expires=Thu, 01-Jan-70 00:00:01 GMT;'; // unset the cookie |
| 74 | + } else { |
| 75 | + output += mw.msg( 'donate_interface-error-msg-cookies' ); // display error |
| 76 | + } |
| 77 | + |
70 | 78 | if( output ) { |
71 | 79 | alert( output ); |
72 | 80 | return false; |
Index: trunk/extensions/DonationInterface/gateway_forms/TwoColumnLetter7.php |
— | — | @@ -110,9 +110,17 @@ |
111 | 111 | var dotpos = document.payment.emailAdd.value.lastIndexOf("."); |
112 | 112 | |
113 | 113 | if( apos < 1 || dotpos-apos < 2 ) { |
114 | | - output += payflowproGatewayErrorMsgEmail; |
| 114 | + output += payflowproGatewayErrorMsgEmail + '.\\r\\n'; |
115 | 115 | } |
116 | 116 | } |
| 117 | + |
| 118 | + // Make sure cookies are enabled |
| 119 | + document.cookie = 'wmf_test=1;'; |
| 120 | + if ( document.cookie.indexOf( 'wmf_test=1' ) != -1 ) { |
| 121 | + document.cookie = 'wmf_test=; expires=Thu, 01-Jan-70 00:00:01 GMT;'; // unset the cookie |
| 122 | + } else { |
| 123 | + output += 'Please enable cookies in your browser.'; // display error |
| 124 | + } |
117 | 125 | |
118 | 126 | if( output ) { |
119 | 127 | alert( output ); |
Index: trunk/extensions/DonationInterface/gateway_forms/TwoStepTwoColumnLetter3.php |
— | — | @@ -93,8 +93,16 @@ |
94 | 94 | var dotpos = document.payment.emailAdd.value.lastIndexOf("."); |
95 | 95 | |
96 | 96 | if( apos < 1 || dotpos-apos < 2 ) { |
97 | | - output += mw.msg( 'donate_interface-error-msg-email' ); |
| 97 | + output += mw.msg( 'donate_interface-error-msg-email' ) + '.\\r\\n'; |
98 | 98 | } |
| 99 | + |
| 100 | + // Make sure cookies are enabled |
| 101 | + document.cookie = 'wmf_test=1;'; |
| 102 | + if ( document.cookie.indexOf( 'wmf_test=1' ) != -1 ) { |
| 103 | + document.cookie = 'wmf_test=; expires=Thu, 01-Jan-70 00:00:01 GMT;'; // unset the cookie |
| 104 | + } else { |
| 105 | + output += mw.msg( 'donate_interface-error-msg-cookies' ); // display error |
| 106 | + } |
99 | 107 | |
100 | 108 | if( output ) { |
101 | 109 | alert( output ); |
Index: trunk/extensions/DonationInterface/gateway_forms/TwoStepTwoColumnPremiumUS.php |
— | — | @@ -99,8 +99,16 @@ |
100 | 100 | var dotpos = document.payment.emailAdd.value.lastIndexOf("."); |
101 | 101 | |
102 | 102 | if( apos < 1 || dotpos-apos < 2 ) { |
103 | | - output += payflowproGatewayErrorMsgEmail; |
| 103 | + output += payflowproGatewayErrorMsgEmail + '.\\r\\n'; |
104 | 104 | } |
| 105 | + |
| 106 | + // Make sure cookies are enabled |
| 107 | + document.cookie = 'wmf_test=1;'; |
| 108 | + if ( document.cookie.indexOf( 'wmf_test=1' ) != -1 ) { |
| 109 | + document.cookie = 'wmf_test=; expires=Thu, 01-Jan-70 00:00:01 GMT;'; // unset the cookie |
| 110 | + } else { |
| 111 | + output += 'Please enable cookies in your browser.'; // display error |
| 112 | + } |
105 | 113 | |
106 | 114 | if( output ) { |
107 | 115 | alert( output ); |
Index: trunk/extensions/DonationInterface/gateway_forms/OneStepTwoColumn.php |
— | — | @@ -81,9 +81,17 @@ |
82 | 82 | var dotpos = document.payment.emailAdd.value.lastIndexOf("."); |
83 | 83 | |
84 | 84 | if( apos < 1 || dotpos-apos < 2 ) { |
85 | | - output += payflowproGatewayErrorMsgEmail; |
| 85 | + output += payflowproGatewayErrorMsgEmail + '.\\r\\n'; |
86 | 86 | } |
87 | 87 | } |
| 88 | + |
| 89 | + // Make sure cookies are enabled |
| 90 | + document.cookie = 'wmf_test=1;'; |
| 91 | + if ( document.cookie.indexOf( 'wmf_test=1' ) != -1 ) { |
| 92 | + document.cookie = 'wmf_test=; expires=Thu, 01-Jan-70 00:00:01 GMT;'; // unset the cookie |
| 93 | + } else { |
| 94 | + output += 'Please enable cookies in your browser.'; // display error |
| 95 | + } |
88 | 96 | |
89 | 97 | if( output ) { |
90 | 98 | alert( output ); |
Index: trunk/extensions/DonationInterface/modules/validate_input.js |
— | — | @@ -82,11 +82,13 @@ |
83 | 83 | } |
84 | 84 | |
85 | 85 | // validate email address |
86 | | - var apos = form.emailAdd.value.indexOf("@"); |
87 | | - var dotpos = form.emailAdd.value.lastIndexOf("."); |
88 | | - |
89 | | - if( apos < 1 || dotpos-apos < 2 ) { |
90 | | - output += mw.msg( 'donate_interface-error-msg-email' ) + '.\r\n'; |
| 86 | + if( document.getElementById( 'emailAdd' ).value != '' && document.getElementById( 'emailAdd' ).value != mw.msg( 'donate_interface-donor-emailAdd' ) ) { |
| 87 | + var apos = form.emailAdd.value.indexOf("@"); |
| 88 | + var dotpos = form.emailAdd.value.lastIndexOf("."); |
| 89 | + |
| 90 | + if( apos < 1 || dotpos-apos < 2 ) { |
| 91 | + output += mw.msg( 'donate_interface-error-msg-email' ) + '.\r\n'; |
| 92 | + } |
91 | 93 | } |
92 | 94 | |
93 | 95 | // Make sure cookies are enabled |
— | — | @@ -146,11 +148,13 @@ |
147 | 149 | } |
148 | 150 | |
149 | 151 | // validate email address |
150 | | - var apos = form.emailAdd.value.indexOf("@"); |
151 | | - var dotpos = form.emailAdd.value.lastIndexOf("."); |
152 | | - |
153 | | - if( apos < 1 || dotpos-apos < 2 ) { |
154 | | - output += mw.msg( 'donate_interface-error-msg-email' ) + '.\r\n'; |
| 152 | + if( document.getElementById( 'emailAdd' ).value != '' && document.getElementById( 'emailAdd' ).value != mw.msg( 'donate_interface-donor-emailAdd' ) ) { |
| 153 | + var apos = form.emailAdd.value.indexOf("@"); |
| 154 | + var dotpos = form.emailAdd.value.lastIndexOf("."); |
| 155 | + |
| 156 | + if( apos < 1 || dotpos-apos < 2 ) { |
| 157 | + output += mw.msg( 'donate_interface-error-msg-email' ) + '.\r\n'; |
| 158 | + } |
155 | 159 | } |
156 | 160 | |
157 | 161 | // Make sure cookies are enabled |