1(function($) { 2 $(function(){ 3 $("#donation_amount").keydown(function (e) { 4 // Allow: backspace, delete, tab, escape, enter and . 5 if ($.inArray(e.keyCode, [46, 8, 9, 27, 13, 110, 190]) !== -1 || 6 // Allow: Ctrl+A, Command+A 7 (e.keyCode === 65 && (e.ctrlKey === true || e.metaKey === true)) || 8 // Allow: home, end, left, right, down, up 9 (e.keyCode >= 35 && e.keyCode <= 40)) { 10 // let it happen, don't do anything 11 return; 12 } 13 // Ensure that it is a number and stop the keypress 14 if ((e.shiftKey || (e.keyCode < 48 || e.keyCode > 57)) && (e.keyCode < 96 || e.keyCode > 105)) { 15 e.preventDefault(); 16 } 17 }); 18 19 $('.paypal-form input[type="submit"]').click(function(e){ 20 if ($("#donation_amount").val() < 10) { 21 alert("A minimum donation amount of $10 is required."); 22 e.preventDefault(); 23 } 24 }); 25 }); 26})( jQuery );
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.