1$(document).ready(function ($) { 2 $('#select_all').click(function () { 3 set_checked_property(true); 4 }); 5 $('#clear_all').click(function () { 6 set_checked_property(false); 7 }); 8 $('#unsubscribe').click(function () { 9 set_checked_property(false); 10 }); 11 12 function set_checked_property(value) { 13 $('#interest_card_list :checkbox').prop('checked', value); 14 } 15 16 if ($('#user_exists').val() == 'true') { 17 $('#login_notice_popup').dialog( 18 { 19 modal: true, 20 title: "", 21 width: '500px', 22 buttons: { 23 "Okay": function () { 24 window.location = window.login_path 25 }, 26 Cancel: function () { 27 $(this).dialog("close"); 28 } 29 } 30 }); 31 $(".ui-dialog-titlebar").hide(); 32 } 33 34 $('form#new_user').off('submit').on('submit', function(event) { 35 let isValid = true; 36 let firstInvalidField = null; 37 let emptyFields = []; 38 39 $('input[required]').each(function() { 40 if ($(this).val() === '') { 41 $(this).addClass('border-red'); 42 $(this).attr('aria-invalid', 'true'); 43 let fieldName = $(this).attr('name').replace('_', ' ').replace(/\b\w/g, function(l) { return l.toUpperCase() }); 44 let formattedFieldName = fieldName.split('[').pop().replace(']', ''); 45 emptyFields.push(formattedFieldName + ' ' + 'is Required'); 46 if (firstInvalidField === null) { 47 firstInvalidField = $(this); 48 } 49 isValid = false; 50 } else { 51 $(this).removeClass('border-red'); 52 $(this).removeAttr('aria-invalid'); 53 } 54 }); 55 56 if (!isValid) { 57 event.preventDefault(); 58 59 alertMessage = emptyFields.join(', ') + '.'; 60 let alertDiv = $('#alert_message'); 61 if (alertDiv.length === 0) { 62 alertDiv = $('<div id="alert_message" role="alert" aria-live="assertive" class="alert alert-danger"></div>'); 63 alertDiv.insertBefore('h2.pad-left'); 64 } 65 alertDiv.text(alertMessage).show(); 66 67 if (firstInvalidField !== null) { 68 setTimeout(function() { 69 firstInvalidField.focus(); 70 }, 5200); 71 } 72 } 73 }); 74 75});
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.