[RESOLVED] Validate Checkbox field

Hi,

I have this code but it doesn't work on Checkbox fields.

Can you help?

//Custom Error Message -- [Terms & Conditions]
fd.spRendered(function() {
fd.field('Question_x0020_2').validators.push({
    name: 'Terms & Conditions',
    error: 'Please select a Value',
    validate: function(value) {
        if (!value) {
            
            return false;
        }
        return true;
    }
});
});

Dear @Qman,
Please, try:

//Custom Error Message -- [Terms & Conditions]
fd.spRendered(function() {
fd.field('Question_x0020_2').validators.push({
    name: 'Terms & Conditions',
    error: 'Please select a Value',
    validate: function(value) {
        if (value.length == 0) {
            return false;
        }
        return true;
    }
});
});
1 Like