By S.a.r.a on
Hi,
In my form I have something like:
$form['AAAA'] = array(
'#type' => 'fieldset',
'#title' => t('________'),
'#tree' => TRUE,
);
$form['AAAA']['BBBB'] = array(
'#type' => 'textfield',
'#title' => t('_______'),
'#size' => 30,
'#maxlength' => 30,
);
When I'm trying to highlight a particular field in fieldset (when validating), it doesn't work:
form_set_error('BBBB','________');
(I mean it prints the message, but doesn't highlight the field BBBB in red), although this works fine:
form_set_error('AAAA','________');
Could anyone tell me what am I doing wrong, please?...
Thanks,
Sara
Comments
Hello: If you are trying to
Hello:
If you are trying to highlight a field that is nested in a fieldset (like you are doing above) the documentation here (http://api.drupal.org/api/function/form_set_error/6) instructs under the parameters heading
So using that information (and I use this code on a clients website so I know for sure it works) our code should look like this:
form_set_error('AAAA][BBBB', t('Please enter a valid BBBB field below, the value you entered is not allowed'));Make special note of the form_set_error name used again it is
AAAA][BBBBfor the nested element.I hope that helps.
Joshua Powell
www.developedsimple.com
Works. Thank u.
Works. Thank u.