
By saleempbt5 on
hello...
can anybody help me with the code to create custom user registration form similar to
http://zealind.com/?q=user/register&destination=user
with my own div wrappers and css class names ?...
hello...
can anybody help me with the code to create custom user registration form similar to
http://zealind.com/?q=user/register&destination=user
with my own div wrappers and css class names ?...
Comments
you can add new fields to
you can add new fields to existing registration form
go to configuration->account settings->manage fields
then add new fields like First Name and select checkbox which says "Display on user registration form"
Save it
now logout or try to register to website in different browser, you can see the extra fields in registration.
Drupal developer
but can't create a custom template for the registration form..
thanks for your valuable reply ...
by using the above said method, we can only create additional fields in user registration forms.
but how can i give custom class name and div wrappers to the registration form fields..
is there any code to print the fields individually,
something like
$form['username'] ,$form['password'] and so on..
if so i can print those fields any where that i need (any templates.)
hm, I don't know much about
hm, I don't know much about theming as I know we can override existing registration form classes
Drupal developer
well
well then we can learn together....
we can wait for someone else......
definitely there will be some techies , who have enough exposure in theming...
Use Content profile module
You can use Content profile module and create one content type. While creating that contnt type choose checkbox related to content profile and create You custom fields.Those fields will be used in your registration form. You can give any custom id or class to those fields using hook_form_alter .
more simple solution is here
http://www.trellon.com/content/blog/theming-user-register-form-d6
it says some more programmatic approach than, the mixed...
Add this also
or
this also included in the user-register.tpl ..
otherwise the form wont work
also one can change the titles by using the code $form['mail']['#title']='Username/Email'; before rendering the elements..
hook_form_alter
To add custom classes and div wrappers to fields, you will need to create your own module and use hook_form_alter to hook the registration form (http://api.drupal.org/api/drupal/modules%21system%21system.api.php/function/hook_form_alter/7)
To add classes you will need to find the field in the $form array and add to that elements ['#attributes']['class'] array:
To wrap a field in a div, you will need to set the ['#prefix'] and ['#suffix']:
Cheers
Tom
file field in user registration form
please help me with some code or hint to add file field in the user registration form
i want to add a resume field in my user registration form of job portal