Hello im trying to make a checkbox field as Required, just in Plumsailforms. How can i make this?
Regards
Dear @sercon,
If you want to set SharePoint field to required state, but don’t want to do it in List Settings, you can actually add a validator to a field with JS.
Just put the following code inside the JS editor (after changing FIELD_NAME to field’s internal name):
fd.spRendered(function(){
fd.field('FIELD_NAME').validators.push({
name: 'CheckboxValidator',
error: 'Checkboxes are mandatory',
validate: function(value) {
if (value == true || value.length > 0) {
return true;
}
return false;
}
});
});
1 Like