drupal - Disable a Field in a Paragraphs Form -


does know how alter field in paragraphs (ajax) backend form in drupal 8? want disable field, keep visible.

thanks

you can disable form field either using hook_form_alter() or hook_form_form_id_alter().

i suggest use hook_form_form_id_alter(). suppose test modules name , user_register_form id of form.

test_form_user_register_form_alter(&$form, &$form_state, $form_id) {   $form['fieldname'] = array(     '#type' => 'textfield',     '#title' => t('text label'),     '#attributes' => array('disabled' => 'disabled'),   ); } 

happy coding!!!


Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -