diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.register/public/js/validate-register.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.register/public/js/validate-register.js index 2603d165cb..44dc3c5983 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.register/public/js/validate-register.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.register/public/js/validate-register.js @@ -54,6 +54,7 @@ $(document).ready(function(){ var emailInput = $("input#email"); var passwordInput = $("input#password"); var passwordConfirmationInput = $("input#password_confirmation"); + var privacyPolicyConsentInput = $("input#privacy-consent"); var username = usernameInput.val().trim(); var firstname = firstnameInput.val(); @@ -61,6 +62,7 @@ $(document).ready(function(){ var emailAddress = emailInput.val(); var password = passwordInput.val(); var passwordConfirmation = passwordConfirmationInput.val(); + var privacyPolicyConsentChecked = privacyPolicyConsentInput.is(':checked'); var errorMsgWrapper = "#user-create-error-msg"; var errorMsg = "#user-create-error-msg span"; @@ -97,6 +99,9 @@ $(document).ready(function(){ } else if (password != passwordConfirmation) { $(errorMsg).text("Please enter the same password for confirmation."); $(errorMsgWrapper).removeClass("hidden"); + } else if (!privacyPolicyConsentChecked) { + $(errorMsg).text("You need to agree with the Privacy policy in order to register with IoT Server."); + $(errorMsgWrapper).removeClass("hidden"); } else { $(errorMsgWrapper).addClass("hidden"); $("#add-user-btn").prop('disabled', true); diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.register/register.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.register/register.hbs index b9977f909b..0baf1156e0 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.register/register.hbs +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.register/register.hbs @@ -3,7 +3,7 @@ {{#zone "content"}} {{unit "uuf.unit.lib.form-validation"}} -
+

Register

@@ -59,11 +59,27 @@ class="form-control" placeholder="Confirm Password"/>
-
+
+
+ +
+
+ +
+
+ +