Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi! Any way to add spellcheck="true" for all inputs?
Hi! Any way to add spellcheck="true" for all inputs?
Comments
Comment #1
Chi CreditAttribution: Chi commentedYou can implement hook_field_widget_WIDGET_TYPE_form_alter and add spellcheck attribute to required subfields.
Comment #2
UksusoFF CreditAttribution: UksusoFF commentedWhat's WIDGET_TYPE for textfield_&_textarea widget?
Comment #3
Chi CreditAttribution: Chi commentedThe type evidently is textfield_&_textarea. However the function cannot be called hook_field_widget_textfield_&_textarea_form_alter because PHP does not support ampersands in function name. So use HOOK_field_widget_form_alter with custom condition.
Comment #4
UksusoFF CreditAttribution: UksusoFF commentedSo i need check isset ($element['first']) or isset ($element['second']) for detect double field? Or maybe proper way for this?
Comment #5
Chi CreditAttribution: Chi commentedComment #6
UksusoFF CreditAttribution: UksusoFF commentedThanks!