r101679 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r101678‎ | r101679 | r101680 >
Date:20:53, 2 November 2011
Author:kaldari
Status:ok
Tags:
Comment:
fixing form validation for internet explorer placeholder compatibility
Modified paths:
  • /trunk/extensions/DonationInterface/donationinterface.php (modified) (history)
  • /trunk/extensions/DonationInterface/gateway_common/interface.i18n.php (modified) (history)
  • /trunk/extensions/DonationInterface/globalcollect_gateway/forms/html/webitects_2_3step.html (modified) (history)
  • /trunk/extensions/DonationInterface/payflowpro_gateway/validate_input.js (modified) (history)

Diff [purge]

Index: trunk/extensions/DonationInterface/donationinterface.php
@@ -548,6 +548,7 @@
549549 'donate_interface-error-msg-city',
550550 'donate_interface-error-msg-state',
551551 'donate_interface-error-msg-zip',
 552+ 'donate_interface-error-msg-postal',
552553 'donate_interface-error-msg-country',
553554 'donate_interface-error-msg-card_type',
554555 'donate_interface-error-msg-card_num',
@@ -555,6 +556,15 @@
556557 'donate_interface-error-msg-cvv',
557558 'donate_interface-error-msg-captcha',
558559 'donate_interface-error-msg-captcha-please',
 560+ 'donate_interface-donor-fname',
 561+ 'donate_interface-donor-lname',
 562+ 'donate_interface-donor-street',
 563+ 'donate_interface-donor-city',
 564+ 'donate_interface-donor-state',
 565+ 'donate_interface-donor-zip',
 566+ 'donate_interface-donor-postal',
 567+ 'donate_interface-donor-country',
 568+ 'donate_interface-donor-emailAdd',
559569 )
560570 );
561571
Index: trunk/extensions/DonationInterface/payflowpro_gateway/validate_input.js
@@ -52,10 +52,10 @@
5353 var output = '';
5454 var currField = '';
5555 var i = 0;
56 - var fields = [ "emailAdd","fname","lname","street","city","zip" ],
 56+ var fields = [ 'fname','lname','street','city','zip', 'emailAdd' ],
5757 numFields = fields.length;
5858 for( i = 0; i < numFields; i++ ) {
59 - if( document.getElementById( fields[i] ).value == '' ) {
 59+ if( document.getElementById( fields[i] ).value == '' || document.getElementById( fields[i] ).value == mw.msg( 'donate_interface-donor-'+fields[i] ) ) {
6060 currField = mw.msg( 'donate_interface-error-msg-' + fields[i] );
6161 output += mw.msg( 'donate_interface-error-msg-js' ) + ' ' + currField + '.\r\n';
6262 }
Index: trunk/extensions/DonationInterface/globalcollect_gateway/forms/html/webitects_2_3step.html
@@ -82,7 +82,7 @@
8383 <option value="AK">AK</option><option value="AL">AL</option><option value="AR">AR</option><option value="AZ">AZ</option><option value="CA">CA</option><option value="CO">CO</option><option value="CT">CT</option><option value="DC">DC</option><option value="DE">DE</option><option value="FL">FL</option><option value="GA">GA</option><option value="HI">HI</option><option value="IA">IA</option><option value="ID">ID</option><option value="IL">IL</option><option value="IN">IN</option><option value="KS">KS</option><option value="KY">KY</option><option value="LA">LA</option><option value="MA">MA</option><option value="MD">MD</option><option value="ME">ME</option><option value="MI">MI</option><option value="MN">MN</option><option value="MO">MO</option><option value="MS">MS</option><option value="MT">MT</option><option value="NC">NC</option><option value="ND">ND</option><option value="NE">NE</option><option value="NH">NH</option><option value="NJ">NJ</option><option value="NM">NM</option><option value="NV">NV</option><option value="NY">NY</option><option value="OH">OH</option><option value="OK">OK</option><option value="OR">OR</option><option value="PA">PA</option><option value="PR">PR</option><option value="RI">RI</option><option value="SC">SC</option><option value="SD">SD</option><option value="TN">TN</option><option value="TX">TX</option><option value="UT">UT</option><option value="VA">VA</option><option value="VT">VT</option><option value="WA">WA</option><option value="WI">WI</option><option value="WV">WV</option><option value="WY">WY</option><option value="AA">AA</option><option value="AE">AE</option><option value="AP">AP</option>
8484 </select>
8585 </span>
86 - <span class="loc-postal"><input class="txt" id="zip" name="zip" title="%donate_interface-zip%" value="@zip" placeholder="%donate_interface-zip%"/></span> <!-- TODO: use postal code on non-US -->
 86+ <span class="loc-postal"><input class="txt" id="zip" name="zip" title="%donate_interface-zip%" value="@zip" placeholder="%donate_interface-donor-zip%"/></span> <!-- TODO: use postal code on non-US -->
8787 </div>
8888 <p><input class="txt" title="%donate_interface-donor-email%" id="emailAdd" name="emailAdd" value="@emailAdd" placeholder="%donate_interface-donor-email%"/></p>
8989
Index: trunk/extensions/DonationInterface/gateway_common/interface.i18n.php
@@ -131,6 +131,7 @@
132132 'donate_interface-donor-amount' => 'Amount',
133133 'donate_interface-donor-currency-label' => 'Currency',
134134 'donate_interface-donor-email' => 'Email address',
 135+ 'donate_interface-donor-emailAdd' => 'Email address',
135136 'donate_interface-donor-name' => 'Name',
136137 'donate_interface-donor-fname' => 'First name',
137138 'donate_interface-donor-mname' => 'Middle name',
@@ -138,6 +139,7 @@
139140 'donate_interface-donor-street' => 'Street',
140141 'donate_interface-donor-city' => 'City',
141142 'donate_interface-donor-state' => 'State',
 143+ 'donate_interface-donor-zip' => 'Zip',
142144 'donate_interface-donor-postal' => 'Postal code',
143145 'donate_interface-donor-country' => 'Country/Region',
144146 'donate_interface-donor-address' => 'Address',
@@ -151,6 +153,7 @@
152154 'donate_interface-card-name-visa' => 'Visa',
153155 'donate_interface-card-name-mc' => 'Mastercard',
154156 'donate_interface-card-name-discover' => 'Discover',
 157+ // The key names for the error messages should mostly match up with the donate_interface-donor keys above. (There are a few exceptions for backwards compat.)
155158 'donate_interface-error-msg-nopaypal' => 'Due to a technical error, we cannot send your request to PayPal. Please try using our regular credit card donation form.',
156159 'donate_interface-error-msg' => 'Please enter your $1',
157160 'donate_interface-error-msg-js' => 'Please enter your',
@@ -168,7 +171,8 @@
169172 'donate_interface-error-msg-street' => 'street address',
170173 'donate_interface-error-msg-city' => 'city',
171174 'donate_interface-error-msg-state' => 'state',
172 - 'donate_interface-error-msg-zip' => 'postal code',
 175+ 'donate_interface-error-msg-zip' => 'zip code',
 176+ 'donate_interface-error-msg-postal' => 'postal code',
173177 'donate_interface-error-msg-country' => 'country',
174178 'donate_interface-error-msg-card_type' => 'credit card type',
175179 'donate_interface-error-msg-card_num' => 'credit card number',
@@ -461,6 +465,7 @@
462466 'donate_interface-donor-amount' => '{{Identical|Amount}}',
463467 'donate_interface-donor-currency-label' => '{{Identical|Currency}}',
464468 'donate_interface-donor-email' => '{{Identical|E-mail address}}',
 469+ 'donate_interface-donor-emailAdd' => '{{Identical|E-mail address}}',
465470 'donate_interface-donor-name' => '{{Identical|Name}}',
466471 'donate_interface-donor-fname' => 'Label for field containing first name.',
467472 'donate_interface-donor-mname' => 'Label for field to input middle name.',
@@ -470,6 +475,7 @@
471476 'donate_interface-donor-state' => 'The donor is to select either an U.S. state or "Outside the U.S."
472477
473478 {{Identical|State}}',
 479+ 'donate_interface-donor-zip' => 'Placeholder for zip code field. This should be 7 characters maximum.',
474480 'donate_interface-donor-postal' => 'Label for field to input postal code.',
475481 'donate_interface-donor-country' => 'Label for field with dropdown list of countries/regions.',
476482 'donate_interface-donor-address' => '{{Identical|Address}}',
@@ -531,7 +537,8 @@
532538 'donate_interface-error-msg-street' => '{{Identical|Street}}',
533539 'donate_interface-error-msg-city' => '{{Identical|City}}',
534540 'donate_interface-error-msg-state' => '{{Identical|State}}',
535 - 'donate_interface-error-msg-zip' => 'Used in error message regarding the postal code field.',
 541+ 'donate_interface-error-msg-zip' => 'Used in error message regarding the zip code field.',
 542+ 'donate_interface-error-msg-postal' => 'Used in error message regarding the postal code field.',
536543 'donate_interface-error-msg-country' => '{{Identical|Country}}',
537544 'donate_interface-error-msg-card_num' => 'Used in error message regarding the credit card number field.',
538545 'donate_interface-error-msg-expiration' => 'Used in error message regarding the card expiration date field.',

Follow-up revisions

RevisionCommit summaryAuthorDate
r101746MFT r101074, r101217, r101236, r101382, r101501, r101503, r101504, r101512, r...awjrichards23:23, 2 November 2011

Status & tagging log