Closed (fixed)
Project:
Drupal core
Version:
6.16
Component:
other
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
19 Mar 2010 at 21:11 UTC
Updated:
20 Feb 2012 at 13:00 UTC
on the user registration form I have enable Profile and added a 'First Name' and 'Last Name' field. They are in the array under 'Personal Information'. I would like to have a deafult value of First Name in a light gray in the box rather than a label above, I read through 11heavens ad some other tutes and they talk about adding a terms and conditions but not how to modify the array vaulues for #default_value or maybe there is an easier way? here is what I am trying:
/**
* Theme override for user edit form.
*
* The function is named themename_formid.
*/
function hglitigation_user_register_form($form) {
// Our kickin' mods go here.
$output = '';
// Print out the $form array to see all the elements we are working with.
//$output .= dsm($form);
// Once I know which part of the array I'm after we can change it.
// You can use the normal Form API structure to change things, like so:
// Change the Username field title to Login ID.
$form['Personal Information'']['profile_first_name']['#default_value'] = t('First Name');
// Make sure you call a drupal_render() on the entire $form to make sure you
// still output all of the elements (particularly hidden ones needed
// for the form to function properly.)
$output .= drupal_render($form);
return $output;
}
Comments
Comment #1
kars-t commentedHi
I am closing this issue to clean up the issue queue. Feel free to reopen the issue if there is new information and the problem still resides. If not please make sure you close your issues that you don't need any more.
Maybe you can get support from the local user group. Please take a look at this list at groups.drupal.org.