[英]Alter form in My Account Page of Drupal
I added the Two Fields newly one is Name
and Mobile
.我新添加了两个字段,一个是
Name
和Mobile
。
When I am using the alter in this当我在此使用更改时
$form['field_name']['#access'] = FALSE;
it works, when I want to change the title, type, likewise and button to change the name with OTP of Mobile Number its not working它有效,当我想更改标题,键入,同样和按钮以使用手机号码的 OTP 更改名称时,它不起作用
$form['field_name']['#title'] = t('member name');
I find out the solution for this我找到了解决方案
$form['field_first_name']['und']['0']['value']['#value'] = 'XXXXX';
$form['field_first_name']['und']['0']['value']['#attributes'] = array('readonly' => 'readonly');
Try this.尝试这个。 Suggest me Ok.
建议我好。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.