diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.user.create/public/js/bottomJs.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.user.create/public/js/bottomJs.js index 28d4af3fdb2..83a581368ee 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.user.create/public/js/bottomJs.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.user.create/public/js/bottomJs.js @@ -256,6 +256,9 @@ $(document).ready(function () { } else if (!emailIsValid(emailAddress)) { $(errorMsg).text("Provided email is invalid."); $(errorMsgWrapper).removeClass("hidden"); + } else if (!roles) { + $(errorMsg).text("Role is a required field. It cannot be empty."); + $(errorMsgWrapper).removeClass("hidden"); } else { var addUserFormData = {};