Hello,

I am new to Drupal and I have been exploring a lot of things within the development area. My questions is in regards to a List(text) field type that I created with the widget type of select other list in order to have the list with some options as well as having an option for other that will display a new text field to let the user be specific about the other selection.
I have that field in two forms, my edit profile(user/main) form as well as a profile2 edit form and I want to show the values from the profile2 form into the edit profile. I have been able to bring regular text fields with the code below, but I am not sure how to do the same for the CCK Select Other field type. The code below I am using it in the function block_form_user_profile_form_alter.

$new_fields['field_textfield_example'] = array(
        '#type' => 'textfield',
        '#title' => 'Text example',
        '#name' => 'field_textfield_example[0][value]',
        '#default_value' => $field_textfield_example[0]['value'],
        '#description' => 'Value has been auto filled from your profile2 profile.',
        '#weight' => -188,
        '#disabled' => FALSE,
        '#required' => FALSE,
      );

Any pointers or tips will be appreciate it.

Comments

Jaypan’s picture

CCK or Drupal 7? (It's one or the other not both)

richcfml’s picture

I have install Drupal 7 and I installed the cck_select_other module and I am able to use it to configure a new field in the forms, which is what I am trying to figure out on how to bring the data back from the other form, profile2 form value, into the edit profile form.

This is the description of the module that I installed on the drupal admin area

Adds a new select widget for CCK text (and related field types) that allows users to input either with a select list or a text input box.