Welcome to the nuBuilder Forums!

Join our community by registering and logging in.
As a member, you'll get access to exclusive forums, resources, and content available only to registered users.

Select2 ignoring NoBlanks

Questions related to customising nuBuilder Forte with JavaScript or PHP.
Post Reply
getNo
Posts: 21
Joined: Thu Feb 18, 2021 5:56 pm

Select2 ignoring NoBlanks

Unread post by getNo »

A Select2 Field doenst triggers the NoBlanks Validation.
You do not have the required permissions to view the files attached to this post.
kev1n
nuBuilder Team
Posts: 4562
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 76 times
Been thanked: 528 times
Contact:

Re: Select2 ignoring NoBlanks

Unread post 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;
    
} 
Post Reply