Function to set the form invalid if a text box is empty

Solution

        var checkEmpty = function () {
            var formInvalid = false;
               if ($("#UserRole").val() === '') {
                   formInvalid = true;
               }
            if (formInvalid) {
                alert('The fields is empty. Please Enter the User Role');
                return false;
            }
            else
                return true;

        }

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Create a free website or blog at WordPress.com.

Up ↑

Design a site like this with WordPress.com
Get started