r100909 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r100908‎ | r100909 | r100910 >
Date:23:52, 26 October 2011
Author:awjrichards
Status:ok
Tags:fundraising 
Comment:
Added validation fail if state is not selected when the default state dropdown value is 'YY'
Modified paths:
  • /trunk/extensions/DonationInterface/payflowpro_gateway/form_placeholders.js (modified) (history)

Diff [purge]

Index: trunk/extensions/DonationInterface/payflowpro_gateway/form_placeholders.js
@@ -32,6 +32,11 @@
3333 if (document.getElementById('lname').value == mw.msg( 'donate_interface-donor-lname' )) {
3434 output += mw.msg( 'donate_interface-error-msg-js' ) + ' last name.\r\n';
3535 }
 36+ 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-error-msg-state' ) + '.\r\n';
 40+ }
3641 var countryField = document.getElementById( 'country' );
3742 if( countryField.options[countryField.selectedIndex].value == '' ) {
3843 output += mw.msg( 'donate_interface-error-msg-js' ) + ' ' + mw.msg( 'donate_interface-error-msg-country' ) + '.\r\n';

Status & tagging log