Forum
Adding a field which must be Unique to members registration form
Hi
Is it possible to add a field which must be unique in a similar way that the email you enter must be unique to any that have been used for people to register previously.
Thanks
Neil
There's nothing built in to do that, but it could be done with a validation helper if you have the PHP chops.
Ah right I had the validation helper dropped in which does flag up the same content being used but I got an error at the top of the page because the method doesnt exist.
Is there somewhere I should add this in?
You need to create the validation helper. The format is
ClassName::static_method_name
The method gets passed an argument which is the value of the field. It needs to return
true
orfalse
once you've established if the value is acceptable.I have the validation helper added helper="PerchMembers_Members::check_gui"
Which is when I get the warning saying about the method not existing. Where should I add that in? Is there a way to do it without touching the core files?
You can't add methods to our class. You need to create your own class.