diff --git a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.policy.create/public/js/policy-create.js b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.policy.create/public/js/policy-create.js index 6ee4e6d82..ae8c031a8 100644 --- a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.policy.create/public/js/policy-create.js +++ b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.policy.create/public/js/policy-create.js @@ -355,7 +355,22 @@ validateStep["policy-profile"] = function () { }; continueToCheckNextInputs = false; } - + // For the secure wifi types, it is required to have a password + var wifiTypeUIElement = $("#wifi-type"); + var wifiType = wifiTypeUIElement.find("option:selected").val(); + if (wifiTypeUIElement.is("input:checkbox")) { + wifiType = wifiTypeUIElement.is(":checked").toString(); + } + if (wifiType !== "none") { + if (!$("#wifi-password").val()) { + validationStatus = { + "error": true, + "subErrorMsg": "Password is required for the wifi security type " + wifiType + ". Please provide a password to proceed.", + "erroneousFeature": operation + }; + continueToCheckNextInputs = false; + } + } // at-last, if the value of continueToCheckNextInputs is still true // this means that no error is found if (continueToCheckNextInputs) { diff --git a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.policy.create/public/templates/hidden-operations-android.hbs b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.policy.create/public/templates/hidden-operations-android.hbs index f05d320f9..0756465ed 100644 --- a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.policy.create/public/templates/hidden-operations-android.hbs +++ b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.policy.create/public/templates/hidden-operations-android.hbs @@ -879,7 +879,7 @@