Facebook注册插件未验证复选框字段
我正在使用Facebook注册插件。我还添加了一个复选框字段,在用户注册之前需要对其进行验证 它显示了错误消息,但显示了验证错误。它还允许用户注册到我的站点 这是我的代码:Facebook注册插件未验证复选框字段,facebook,Facebook,我正在使用Facebook注册插件。我还添加了一个复选框字段,在用户注册之前需要对其进行验证 它显示了错误消息,但显示了验证错误。它还允许用户注册到我的站点 这是我的代码: <fb:registration fields="[ {'name':'name'}, {'name':'email'}, {'name':'legal ', 'description':'I accept the legal terms', 'type':'checkbox'
<fb:registration
fields="[
{'name':'name'},
{'name':'email'},
{'name':'legal ', 'description':'I accept the legal terms', 'type':'checkbox', 'default':'checked'}
]"
redirect-uri="http://www.mysite.com/page"
width="710"
onvalidate="validate">
</fb:registration>
<script>
function validate(form) {
errors = {};
if (form.name === "") {
errors.name = "You must fill your name";
}
if (form.email === "") {
errors.email = "You must fill your email";
}
if (!form.legal) {
errors.legal = "You have to accept the legal terms";
}
return errors;
}
</script>
函数验证(表单){
错误={};
如果(form.name==“”){
errors.name=“您必须填写您的姓名”;
}
如果(form.email==“”){
errors.email=“您必须填写您的电子邮件”;
}
如果(!form.legal){
errors.legal=“您必须接受法律条款”;
}
返回错误;
}
这是Facebook的bug吗?还是我做错了什么