How to edit register form
Posted by yuri80
How to edit register form April 29, 2008 11:08AM |
Registered: 17 years ago Posts: 22 |
April 29, 2008 11:17AM |
Admin Registered: 20 years ago Posts: 8,532 |
First create some custom profile fields in the admin interface for storing the data. Then edit register.tpl to add the fields to the input form. That is what is needed to store this data with the user. Additionally, you'll need to edit profile.tpl to display the fields in the profile page.
Maurice Makaay
Phorum Development Team
my blog
linkedin profile
secret sauce
Maurice Makaay
Phorum Development Team



Re: How to edit register form April 29, 2008 12:00PM |
Registered: 17 years ago Posts: 22 |
I've created a new input field from the Users/Groups -> Custom profile panel in the admin interface then i edited the register.tpl adding the new input field in the HTML code.
The input field was created but i can't see its label in the register form!
Is it necessary to edit a database table?
I've added the input field from the admin interface but the "phorum_users" and "phorum_user_custom_fields" database tables were not modified.
A last question: is it possible to add also a radio button group, checkboxes, drop-down menu (select) etc?
Thanks again.
The input field was created but i can't see its label in the register form!
Is it necessary to edit a database table?
I've added the input field from the admin interface but the "phorum_users" and "phorum_user_custom_fields" database tables were not modified.
A last question: is it possible to add also a radio button group, checkboxes, drop-down menu (select) etc?
Thanks again.
April 29, 2008 12:27PM |
Admin Registered: 20 years ago Posts: 8,532 |
Quote
yuri80
The input field was created but i can't see its label in the register form!
Did you use something like {LANG->labelname} for that? You should simply put the string in the register form that you need. If you use {LANG->labelname}, then you need to add "labelname" to the language file that you are using.
Quote
yuri80
Is it necessary to edit a database table?
No.
Quote
I've added the input field from the admin interface but the "phorum_users" and "phorum_user_custom_fields" database tables were not modified.
That's correct. The phorum_user_custom_fields table will retrieve data when custom fields are filled. You'll see no changes on beforehhand.
Quote
A last question: is it possible to add also a radio button group, checkboxes, drop-down menu (select) etc?
It's possible to use any kind of HTML form field in there. Only checkboxes are special, because for checkboxes there will be no form field posted at all when the checkbox is unchecked at post. There are several options for working around that, but some coding skills are needed. You could:
- add a hidden field with the real field name to the form. Then add a checkbox, which changes the value of the hidden field based on its check status.
- Write a module that hooks into the before_register hook to fill the user data field based on the checkbox status.
Maurice Makaay
Phorum Development Team



Re: How to edit register form April 30, 2008 03:34AM |
Registered: 17 years ago Posts: 22 |
Sorry, only registered users may post in this forum.