0
我正在使用Facebook注册插件。我添加了一个复选框字段,我需要验证以在用户注册之前进行检查。Facebook注册插件未验证复选框字段
它显示了错误信息,但却忽略了验证错误,它也允许用户注册到我的网站。
这是我的代码:
<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>
这是Facebook的错误吗?或者是我做错了什么?