Well I have tried and tried to use form_alter in every way I could think of and in ways that others have but the code is just ignored or goes to error;
function profilecloud_form_alter($form_id, &$form) {
$category = 'Medlemskonventet 2006';
if ($form_id == 'user_edit') {
$alteration = array('#description' => t('ALTERED!!!!'));
$form[$category]['edit-profile_matchmaking_2006'] = array_merge($form[$category]['edit-profile_matchmaking_2006'], $alteration);
}
}
produces a array merge error. $form[$category]['edit-profile_matchmaking_2006'] is not recognized as an array and forcing it returns no changes.
To get it to change this works. But the result is another complete form with a change within the original form.
function profilecloud_form_alter($form_id, &$form) {
$category = 'Medlemskonventet 2006';
if ($form_id == 'user_edit') {
$alteration = array('#description' => t('ALTERED!!!!'));
$form[$category]['edit-profile_matchmaking_2006'] = array_merge($form[$category], $alteration);
}
}
Carl Mc Dade <carl_mcdade@yahoo.com> wrote:
I am adding a markup field to a Profile form but only want the field to show after a certain textarea. The idea is to use the links in the markup field to enter text in the textarea above it. I have set in the working code and have no problem with it but am questioning the fact that hardcoding this in seems to be the only way.
Is there a way of doing this using the FormsAPI? a grouping syntax? Something like show this field only if a related field is present?
Is there a hook for FormsAPI that would help?
TIACarl Mc Dade
____________________________
Web Developer for Hire
Yahoo! Messenger with Voice. Make PC-to-Phone Calls to the US (and 30+ countries) for 2�/min or less.