Skip to main content
Share Your Experience: Take the 2024 Developer Survey

New answers tagged

0 votes

How do I add a CSS class to a form label?

Adding a bootstrap class form-check-label to the label element of a checkbox: $form['checkbox_label_example] = [ '#type' => 'checkbox', '#title' => $this->t('Something'), '#...
Rafael's user avatar
  • 339
1 vote

Proper way to get input field value with AJAX

So, you can provide not raw and validated way – Otto Matik The proper & safe way is to get them using $form_state->getValue('field_name') $field_source_values = $form_state->getValue('...
No Sssweat's user avatar
  • 31.3k
2 votes

How override theme for a node add\edit form?

Good try, the proper way: /** * Implements hook_theme(). */ function mymodule_theme($existing, $type, $theme, $path) { return [ 'my_custom_template' => [ 'render element' => 'form',...
No Sssweat's user avatar
  • 31.3k

Top 50 recent answers are included