Hi,
I have used customization in user registration page
my code in template.php is
function CUSTOMTHEME _theme($existing, $type, $theme, $path) {
return array(
// tell Drupal what template to use for the user register form
'user_register' => array(
'arguments' => array('form' => NULL),
'template' => 'user-register', // this is the name of the template
),
);
}
and in user-register.tpl.php is
print drupal_render($form['name']); // prints the username field
print drupal_render($form['mail']); // print the password field
print drupal_render($form['submit']); // print the submit button
But the forms are displaying ( username + email + submit ) in q=user/register url
but while new user register submit button hits the values are not stored in database any solution plz help me to solve this issue
Comments
Comment #1
aharown07 commentedWish I could help with this. Trying to customize my own registration form and it looks like you're ahead of me. Just changing the category here because this doesn't look like a feature request.
Comment #2
sankar_jeya commentedif any idea plz giv tips
Comment #3
sankar_jeya commentedHi,
I have used customization in user registration page
my code in template.php is
function CUSTOMTHEME _theme($existing, $type, $theme, $path) {
return array(
// tell Drupal what template to use for the user register form
'user_register' => array(
'arguments' => array('form' => NULL),
'template' => 'user-register', // this is the name of the template
),
);
}
and in user-register.tpl.php is
But the forms are displaying ( username + email + submit ) in q=user/register url
but while new user register submit button hits the values are not stored in database any solution plz help me to solve this issue
Comment #4
dawehneryou have to render also this:
Comment #5
sankar_jeya commentedthanks dereine this works right
Comment #6
dawehnerso this is fixed
Comment #8
heine commentedThe advice on #5 is not entirely correct.
You need to render the _rest_ of the form, not just a few specific fields with drupal_render($form). If you don't do this, you rely on FAPI implementation details. (Internal) fields may be added.
drupal_render_form allows this because it only renders elements once; calling it on $form won't get you elements that were already rendered.
Comment #9
sankar_jeya commentedsorry for this mistake if any plz note
Comment #10
hoamer commentedHi there,
I wanted to fill a field (city) after quering the value from a database.
It's hard to get it to work with the computed module, so i decided to solve it with a custom registration-form.
My user-register.tpl.php looks like this:
When I submit the form there is no response from it. No storing of the values.
So I added
as dereine in #4 said.
After adding it, i got an error, but can't explain why.
A not allowed selection was discovered.I would be pleased, if someone can give me an explanation of what I am doing wrong and how to make it work.
Thanks ;)
Greetings
Hoamer
Comment #11
pasquallein D7 use
print drupal_render_children($form);@hoamer: your problem is with the location field, that you did not render all of its elements.