如何访问用户个人资料表单上字段组内的字段?
在我的自定义模块中,我可以使用下面的代码修改帐户名称和电子邮件没问题。
$form['account']['name']['#description'] = 'Enter a username';
$form['account']['mail']['#description'] = 'Enter a valid email address';
这不能修改个人信息字段组中的字段:
$form['Personal information']['profile_name']['#description'] = 'Enter a valid email address';
我尝试访问的数组部分位于下方。
[Personal information] => Array
(
[#type] => fieldset
[#title] => Personal information
[#weight] => 1
[profile_name] => Array
(
[#type] => textfield
[#title] => First name
[#default_value] =>
[#maxlength] => 255
[#description] => Enter your first name. The content of this field is kept private and will not be shown publicly.
[#required] => 1
[#input] => 1
答案 0 :(得分:0)
我认为如果你必须在$ form对象中找到'submitted'数组并更改那里的数据。
所以例如:
$form['account']['mail']['#description'] = 'Enter a valid email address';
bocome(在我的情况下):
$form['submitted']['account']['mail']['#description'] = 'Enter a valid email address';