MCPcopy
hub / github.com/bradtraversy/vanillawebprojects / checkRequired

Function checkRequired

form-validator/script.js:32–44  ·  view source on GitHub ↗
(inputArr)

Source from the content-addressed store, hash-verified

30
31// Check required fields
32function checkRequired(inputArr) {
33 let isRequired = false;
34 inputArr.forEach(function(input) {
35 if (input.value.trim() === '') {
36 showError(input, `${getFieldName(input)} is required`);
37 isRequired = true;
38 } else {
39 showSuccess(input);
40 }
41 });
42
43 return isRequired;
44}
45
46// Check input length
47function checkLength(input, min, max) {

Callers 1

script.jsFile · 0.85

Calls 3

showErrorFunction · 0.85
getFieldNameFunction · 0.85
showSuccessFunction · 0.85

Tested by

no test coverage detected