Index: trunk/extensions/DonationInterface/payflowpro_gateway/forms/html/globalcollect_test.html |
— | — | @@ -5,6 +5,60 @@ |
6 | 6 | .step2hidden{ display:none; } |
7 | 7 | #footer-places { display:none; } |
8 | 8 | </style> |
| 9 | + |
| 10 | +<script type="text/javascript"> |
| 11 | +function formCheck( ccform ) { |
| 12 | + var msg = [ 'EmailAdd', 'Fname', 'Lname', 'Street', 'City', 'Zip' ]; |
| 13 | + |
| 14 | + var fields = ["emailAdd","fname","lname","street","city","zip" ], |
| 15 | + numFields = fields.length, |
| 16 | + i, |
| 17 | + output = '', |
| 18 | + currField = ''; |
| 19 | + |
| 20 | + for( i = 0; i < numFields; i++ ) { |
| 21 | + if( document.getElementById( fields[i] ).value == '' ) { |
| 22 | + currField = window['payflowproGatewayErrorMsg'+ msg[i]]; |
| 23 | + output += payflowproGatewayErrorMsgJs + ' ' + currField + '.\r\n'; |
| 24 | + } |
| 25 | + } |
| 26 | + |
| 27 | + if (document.getElementById('fname').value == '$first') { |
| 28 | + output += payflowproGatewayErrorMsgJs + ' first name.\r\n'; |
| 29 | + } |
| 30 | + if (document.getElementById('lname').value == '$last') { |
| 31 | + output += payflowproGatewayErrorMsgJs + ' last name.\r\n'; |
| 32 | + } |
| 33 | + if (document.getElementById('street').value == '$street') { |
| 34 | + output += payflowproGatewayErrorMsgJs + ' street address.\r\n'; |
| 35 | + } |
| 36 | + if (document.getElementById('city').value == '$city') { |
| 37 | + output += payflowproGatewayErrorMsgJs + ' city.\r\n'; |
| 38 | + } |
| 39 | + if (document.getElementById('zip').value == '$zip') { |
| 40 | + output += payflowproGatewayErrorMsgJs + ' zip code.\r\n'; |
| 41 | + } |
| 42 | + |
| 43 | + var stateField = document.getElementById( 'state' ); |
| 44 | + if( stateField.options[stateField.selectedIndex].value == '' ) { |
| 45 | + output += payflowproGatewayErrorMsgJs + ' ' + window['payflowproGatewayErrorMsgState'] + '.\r\n'; |
| 46 | + } |
| 47 | + |
| 48 | + // validate email address |
| 49 | + var apos = document.payment.emailAdd.value.indexOf("@"); |
| 50 | + var dotpos = document.payment.emailAdd.value.lastIndexOf("."); |
| 51 | + |
| 52 | + if( apos < 1 || dotpos-apos < 2 ) { |
| 53 | + output += payflowproGatewayErrorMsgEmail; |
| 54 | + } |
| 55 | + |
| 56 | + if( output ) { |
| 57 | + alert( output ); |
| 58 | + return false; |
| 59 | + } |
| 60 | +} |
| 61 | +</script> |
| 62 | + |
9 | 63 | <table width="100%" cellspacing="0" cellpadding="0" border="0"> |
10 | 64 | <tr> |
11 | 65 | <td id="appeal" valign="top"> |
— | — | @@ -61,9 +115,6 @@ |
62 | 116 | <td colspan="2"><span class="creditcard-error-msg">#card#card_num</span></td> |
63 | 117 | </tr> |
64 | 118 | <tr> |
65 | | - <td colspan="2"><span class="creditcard-error-msg">#card</span></td> |
66 | | - </tr> |
67 | | - <tr> |
68 | 119 | <td colspan="2"> |
69 | 120 | <table cellspacing="0" cellpadding="4" border="1" id="donation_amount"> |
70 | 121 | <tr> |
Index: trunk/extensions/DonationInterface/payflowpro_gateway/forms/html/globalcollect_test_2.html |
— | — | @@ -29,6 +29,57 @@ |
30 | 30 | if($(this).attr("placeholder") == $(this).val()) {$(this).val('');} |
31 | 31 | }); |
32 | 32 | }); |
| 33 | + |
| 34 | +function formCheck( ccform ) { |
| 35 | + var msg = [ 'EmailAdd', 'Fname', 'Lname', 'Street', 'City', 'Zip' ]; |
| 36 | + |
| 37 | + var fields = ["emailAdd","fname","lname","street","city","zip" ], |
| 38 | + numFields = fields.length, |
| 39 | + i, |
| 40 | + output = '', |
| 41 | + currField = ''; |
| 42 | + |
| 43 | + for( i = 0; i < numFields; i++ ) { |
| 44 | + if( document.getElementById( fields[i] ).value == '' ) { |
| 45 | + currField = window['payflowproGatewayErrorMsg'+ msg[i]]; |
| 46 | + output += payflowproGatewayErrorMsgJs + ' ' + currField + '.\r\n'; |
| 47 | + } |
| 48 | + } |
| 49 | + |
| 50 | + if (document.getElementById('fname').value == '$first') { |
| 51 | + output += payflowproGatewayErrorMsgJs + ' first name.\r\n'; |
| 52 | + } |
| 53 | + if (document.getElementById('lname').value == '$last') { |
| 54 | + output += payflowproGatewayErrorMsgJs + ' last name.\r\n'; |
| 55 | + } |
| 56 | + if (document.getElementById('street').value == '$street') { |
| 57 | + output += payflowproGatewayErrorMsgJs + ' street address.\r\n'; |
| 58 | + } |
| 59 | + if (document.getElementById('city').value == '$city') { |
| 60 | + output += payflowproGatewayErrorMsgJs + ' city.\r\n'; |
| 61 | + } |
| 62 | + if (document.getElementById('zip').value == '$zip') { |
| 63 | + output += payflowproGatewayErrorMsgJs + ' zip code.\r\n'; |
| 64 | + } |
| 65 | + |
| 66 | + var stateField = document.getElementById( 'state' ); |
| 67 | + if( stateField.options[stateField.selectedIndex].value == '' ) { |
| 68 | + output += payflowproGatewayErrorMsgJs + ' ' + window['payflowproGatewayErrorMsgState'] + '.\r\n'; |
| 69 | + } |
| 70 | + |
| 71 | + // validate email address |
| 72 | + var apos = document.payment.emailAdd.value.indexOf("@"); |
| 73 | + var dotpos = document.payment.emailAdd.value.lastIndexOf("."); |
| 74 | + |
| 75 | + if( apos < 1 || dotpos-apos < 2 ) { |
| 76 | + output += payflowproGatewayErrorMsgEmail; |
| 77 | + } |
| 78 | + |
| 79 | + if( output ) { |
| 80 | + alert( output ); |
| 81 | + return false; |
| 82 | + } |
| 83 | +} |
33 | 84 | </script> |
34 | 85 | |
35 | 86 | |