Solved

change fields order in Drupal 7 register form

Posted on 2013-12-12
4
887 Views
Last Modified: 2013-12-13
Hi,

On my drupal register form, I allowed users to set their own time zone. For some reason, that locale settings is appearing right in the middle of my form. Do you know a Drupal way to move it to the bottom of the form? I went to admin/config/people/accounts/fields but I can´t see that field being added there. So where is it? how can I change its position?

I would greatly appreciate any help on this,


Winter
0
Comment
Question by:glepiza
  • 2
4 Comments
 
LVL 2

Accepted Solution

by:
itkadmin earned 400 total points
ID: 39716729
You could modify the user registration form template. https://drupal.org/node/1211520
0
 
LVL 17

Assisted Solution

by:nanharbison
nanharbison earned 100 total points
ID: 39716969
Did you try going directly to the form page and clicking on WEBFORM? It lets you move the elements around by the cross to the left of each element.
Or is this a specific content type you have created? In this case you go to Structure->content types and manage the display there.
0
 

Author Comment

by:glepiza
ID: 39717596
Hello experts, Thank you for your answers,

I ended up using the link itkadmin provided and it was quite helpful. I am printing all my fields using user-register-form.tpl.php like this:

<?php print render($form['form_id']); ?>
<?php print render($form['form_build_id']); ?>
<?php
 print render ($form['name_first']);
 print render ($form['name_last']);
 print render ($form['city']);
 print render ($form['country']); //This is the Country
 print render ($form['sex']);
 print render ($form['date_of_birth']);
 print render ($form['phone_number']);
 print render ($form['mail']);

the problem I found is that mail is not being printed out. No idea why. I did not created mail for the user registration form, it was actually placed there by the system. But when I do print_r($form) I can see the mail array like this:

[mail] => Array ( [#type] => textfield [#title] => E-mail [#maxlength] => 254 [#description] => A valid e-mail address. All e-mails from the system will be sent to this address. The e-mail address is not made public and will only be used if you wish to receive a new password or wish to receive certain news or notifications by e-mail. [#required] => 1 [#default_value] => [#attributes] => Array ( [placeholder] => xxx@xxx.com )

so I am a little confused.. why it is not outputting the input email field?

Any insight would be greatly appreciated.

Thanks

Winter
0
 

Author Comment

by:glepiza
ID: 39717602
oh, ok, I think I found the answer. It was suppose to be like this:

print render($form['account']['mail']);

thanks!
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

789 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question