https://hearstmediact.com/wp-content/themes/HearstCT/salesforce-contact-form-validation.js?ver=7.1.2
1jQuery(function($) { 2 3 var form = $("#salesforce_contact_form"); 4 if (form.length == 1) { 5 6 $(form).submit(function(e) { 7 var hasErrors = []; 8 $("#error-box", form).hide(); 9 $("input", form).removeClass("has-error"); 10 11 var first_name = $("#first_name", form); 12 if (first_name.val() === "") { 13 first_name.addClass("has-error"); 14 hasErrors.push("first_name"); 15 } 16 17 var last_name = $("#last_name", form); 18 if (last_name.val() === "") { 19 last_name.addClass("has-error"); 20 hasErrors.push("last_name"); 21 } 22 23 var email = $("#email", form); 24 if (email.val() === "") { 25 email.addClass("has-error"); 26 hasErrors.push("email"); 27 } 28 29 var phone = $("#phone", form); 30 if (phone.val() === "") { 31 phone.addClass("has-error"); 32 hasErrors.push("phone"); 33 } 34 35 var company = $("#company", form); 36 if (company.val() === "") { 37 company.addClass("has-error"); 38 hasErrors.push("company"); 39 } 40 41 if (hasErrors.length > 0) { 42 e.preventDefault(); 43 44 var errorBox = $("#error-box", form); 45 if (errorBox.length === 0) errorBox = $('<div id="error-box"></div>').prependTo(form); 46 errorBox.html("Please review your form input. The fields highlighted in red must be filled out.").show(); 47 48 } 49 }); 50 51 } 52 53});
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.