imep-vue-form-builder
Version:
Vue Form Builder PRO MAX built from top of Vue. Super dynamic and flexible including Drag and Drop feature.
18 lines (16 loc) • 366 B
JavaScript
/**
* Require check for validation
* @param {any} fieldValue
* @return {boolean}
*/
export default function requiredRule(fieldValue) {
// for checkboxes / multiple dropdown
if (Array.isArray(fieldValue)) {
return fieldValue.length > 0
}
// for text/number/any...
if (fieldValue === "") {
return false
}
return true
}