I am using Facebook registration plugin. And I added a checkbox field that I need to validate to be checked before the user register.
It is showing the error message but dispite the validation error it is also allowing the user to register to my site.
This is my code:
<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>
Is this a Facebook bug? Or is that I am doing something wrong?
Are U using iframe or xfbml? This solution only works with xfblm!!
Actual the use of onvalidate=”validate” only is in App-sites (apps.facebook.com/…) possible.
If you use it inside a facebook app its not working.