简体   繁体   中英

Alter form in My Account Page of Drupal

I added the Two Fields newly one is Name and 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

$form['field_name']['#title'] = t('member name');

My account image

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM