Page 1 of 1

Select2 ignoring NoBlanks

Posted: Tue Mar 09, 2021 1:14 pm
by getNo
A Select2 Field doenst triggers the NoBlanks Validation.

Re: Select2 ignoring NoBlanks

Posted: Tue Mar 09, 2021 1:52 pm
by kev1n
Hi,

The "cannot be left blank" even doesn't appear when not using select2. This looks like a bug (but just if "multiple" is ticked)

In the meantime, you could add some JavaScript in the form's Custom Code to check for no blanks.

Code: Select all

function nuBeforeSave(){

    if( $('#fuer_unternehmen_id').val().length == 0 ){     // <<--- Replace with your Object ID !    
        nuMessage(['<b>für Unternehmen</b> ' + nuTranslate('cannot be left blank')]);
        // Cancel saving         
        return false;

    }

    // Continue Saving
    return true;
    
}