Javascript在azure ad b2c自定义注册页面中不起作用

Javascript在azure ad b2c自定义注册页面中不起作用,javascript,azure,azure-ad-b2c,Javascript,Azure,Azure Ad B2c,我已经在azure ad b2c中创建了自定义注册页面,但javascript不起作用 我还在属性中启用了[Enable JavaScript enforcing page layout]选项 ***目前我使用的是userflow而不是自定义策略 自定义页面示例: <!DOCTYPE html> <!-- saved from url=(0080)../assets/AzureBlue/selfAsserted.cshtml --> <html><hea

我已经在azure ad b2c中创建了自定义注册页面,但javascript不起作用

我还在属性中启用了[Enable JavaScript enforcing page layout]选项

***目前我使用的是userflow而不是自定义策略

自定义页面示例:

<!DOCTYPE html>
<!-- saved from url=(0080)../assets/AzureBlue/selfAsserted.cshtml -->
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    
    <title>Sign up</title>

    
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link href="https://ajax.aspnetcdn.com/ajax/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet" type="text/css" />

    <link href="https://demostorage.z11.web.core.windows.net/slate_gray/css/assets.css" rel="stylesheet" type="text/css" />
    <link href="https://demostorage.z11.web.core.windows.net/slate_gray/css/common.css" rel="stylesheet" type="text/css" />
    <link href="https://demostorage.z11.web.core.windows.net/slate_gray/css/selfasserted.css" rel="stylesheet" type="text/css" />

    <style>
        .tnc-container {
            height: 100px; 
            overflow-y: scroll;
            text-align: left !important;
            border: 1px gray solid;
            padding: 5px;
            margin: 20px 0px 0px 0px;
        }

        .buttons #continue {
            float: none !important;
        }
    </style>

    <script>
        document.addEventListener('DOMContentLoaded', function() {
            var checkbox = document.querySelector("input[type=checkbox]");
            checkbox.addEventListener( 'change', function(e) {
                var currentdate = new Date(); 
                var datetime = currentdate.getFullYear() + "/"
                                + (currentdate.getMonth()+1)  + "/" 
                                + currentdate.getDate() + " "  
                                + currentdate.getHours() + ":"  
                                + currentdate.getMinutes() + ":" 
                                + currentdate.getSeconds();

                this.value = datetime;
            });
        }, false);
    </script>

</head>
<body>
    <div class="container  self_asserted_container ">
        <div class="row">
            <div class="col-lg-6">
                <div class="panel panel-default">
                    <div class="panel-body">
                        <img alt="Company Logo" class="companyLogo" src="https://demostorage.z11.web.core.windows.net/assets/images/logo.svg">
                        <div id="api">
                        </div>
                        <div class="tnc-container">
                            <b>Terms and Conditions Sample Generator</b> <br>
Help protect your website and its users with clear and fair website terms and conditions. These terms and conditions for a website set out key issues such as acceptable use, privacy, cookies, registration and passwords, intellectual property, links to other sites, termination and disclaimers of responsibility. Terms and conditions are used and necessary to protect a website owner from liability of a user relying on the information or the goods provided from the site then suffering a loss.

Making your own terms and conditions for your website is hard, not impossible, to do. It can take a few hours to few days for a person with no legal background to make. But worry no more; we are here to help you out.

All you need to do is fill up the blank spaces and then you will receive an email with your personalized terms and conditions.
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>


</body></html>

注册
.tnc集装箱{
高度:100px;
溢出y:滚动;
文本对齐:左!重要;
边框:1px灰色实体;
填充物:5px;
保证金:20px 0px 0px 0px;
}
.按钮#继续{
浮动:无!重要;
}
document.addEventListener('DOMContentLoaded',function(){
var checkbox=document.querySelector(“输入[type=checkbox]”);
复选框.addEventListener('change',函数(e){
var currentdate=新日期();
var datetime=currentdate.getFullYear()+“/”
+(currentdate.getMonth()+1)+“/”
+currentdate.getDate()+“”
+currentdate.getHours()+“:”
+currentdate.getMinutes()+“:”
+currentdate.getSeconds();
this.value=日期时间;
});
},假);
条款和条件样本生成器
用清晰、公平的网站条款和条件帮助保护您的网站及其用户。网站的这些条款和条件规定了关键问题,如可接受的使用、隐私、cookie、注册和密码、知识产权、与其他网站的链接、终止和免责声明。条款和条件用于保护网站所有者免受用户依赖网站提供的信息或商品而遭受损失的责任。 为你的网站制定自己的条款和条件是很难的,不是不可能的。对于一个没有法律背景的人来说,这可能需要几个小时到几天的时间。但别再担心了;我们是来帮你的。 所有你需要做的就是填空,然后你会收到一封电子邮件,你的个性化条款和条件。
我已经在本地测试了这个javascript。。。它工作正常


使用javascript函数,我想将当前日期时间存储在复选框“服务团队同意”复选框中,您可以使用
组合的SignupandSignin
策略,并通过 后续过程

转到用户流属性

  • 选择页面布局
  • 选择“本地帐户注册页面”
  • 用户属性
    下,找到应为布尔值的属性
  • 用户输入类型设置为
    复选框MultiSelect
  • 然后转到用户流中的“语言”菜单

  • 启用
    语言自定义
  • 下载
    “本地帐户注册页面”
    的英文默认语言文件
  • 在“LocalizedCollections”中查找扩展属性名称
  • 添加一个值,如下所示:
  • 保存您的文件并将其作为覆盖上传到英语本地化。 您现在应该看到该复选框,选中时将返回
    True
    ,未选中时返回
    False

    有一个与此相关的对话框,其中显示一个复选框,并写入所显示的TOU版本


    您需要提供TOU,或者您可以将其写入
    段落

    您会遇到什么错误?@juunas没有收到任何错误,但无法通过您提供的代码工作,我得到了一些结果userflow,它可以工作,您的意思是根本不显示在您的位置,对吗?您可以提供sreenshots吗?您是否尝试在脚本中添加
    console.log
    调用以查看发生了什么?为什么不在服务器端使用自定义策略dateTime ClaimsFormation生成dateTime?你的路不安全。
      "Items":[
    {
         "Name":"Agree",
         "Value":"True"
    }