I want to create a plugin to extend the registration form. Specificaly I want to add three extra fields, one for country, one for postal code and one for telephone number. I know that this can be done with the Profile Manager plugin. But I also want to do some custom validation in those fields. For example based on selected country a custom validation for the telephone.
Is there any example of how to create a plugin that extends the registration form?
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by RaĆ¼l Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.
- Nikolai Shcherbin@rivervanrain
Nikolai Shcherbin - 0 likes
- Sisyphus@Sisyphus
Sisyphus - 0 likes
- Team Webgalli@webgalli
Team Webgalli - 0 likes
- Sisyphus@Sisyphus
Sisyphus - 0 likes
You must log in to post replies.This plugin works with Profile Manager. try it
Thanks. It is a very interesting plugin and I sure will find a use for it.
But what I would like is to create my own plugin with my form. There are many fields that need custom validation so I am afraid a custom plugin is the way to go. Unfortunately I am total begginer so I would like to know if there is a simple plugin or example that does something simmilar so I can adapt it in my own plugin.
With in the init function of your plugin, extend the registration form like
create a file called registration_form_extension.php inside mod/my_plugin/views/default/my_plugin with the additional fields.
Now you need to hook into the registration action and get the input fields and process it as per your needs.
Thanks. I saw the line
and I was curious how to use that. Thank you for showing this.
For my form I found this discussion https://community.elgg.org/discussion/view/839506/registration-page and I think this will be a better option as I want to change completely the form and I also want a bare html form so I can apply my own form. Also I found this thread https://community.elgg.org/discussion/view/891630/custom-registration-form that explains how to unregister the registration form and register mine. I hope this is still the correct way for 1.8