CKL
  • Member for 4 years, 6 months
  • Last seen more than a month ago
Adding form placeholders to text input fields
1 votes

Simply add the code for placeholder text /** * Implements hook_form_alter */ function MODULENAME_form_alter(&$form, \Drupal\Core\Form\FormStateInterface $form_state, $form_id) { form['...

View answer
How do I generate PDF of HTML in a custom module?
1 votes

You can generate PDF Using Html using dompdf In my case I need to create a pdf from a custom menu callback. So to achieve this Step 1 : Download dompdf library Step 2 : Place the library in sites/...

View answer
hook_nodeapi called multiple times with op='update'
0 votes

There is a chance to call hook_node_update multiple times if you use field collection items in your content type. The call times depends on the content in the field collection items

View answer
Programmatically update field collection data in custom entity
0 votes

Please use below code for update existing field collection data //$item_id load item id from your node //enter_update_field_mechine_name replace with your field name $field_collection_value = ...

View answer
Custom Password validation on Drupal 7 form
0 votes

If you want to use password field in custom form do not have to use any custom modules use drupal password settings. Just add type as 'password_confirm' in your form. This automatically add confirm ...

View answer