I cannot set a custom CSS class for a submit button using code like:

 $form['actions']['submit'] = array(
      '#attributes' => array(
        'class' => array('editablefields-submit'),
      ),
);

The issue is that my classes are overwritten by alters in form.inc, lines 25-29. There are also some other classes overwritten in that function.

Tested on 7.x-5.0-alpha8, but (based on code review) the issue is also present in latest 5.x dev.

Comments

lklimek’s picture

shauntyndall’s picture

Version: 7.x-5.0-alpha8 » 7.x-5.x-dev
Assigned: Unassigned » shauntyndall
Status: Active » Needs review

  • shauntyndall committed 9b2dc0c on 7.x-5.x authored by lklimek
    Issue #2342691 by lklimek: Button classes overwriten by "sexy submit...
shauntyndall’s picture

Status: Needs review » Fixed

@lklimek I refactored the patch a bit because it didn't apply to the current 5.x-dev HEAD. The "sexy submit button" classes should now cooperate with your code. It certainly is an improvement. Thanks!

  • shauntyndall committed e660a85 on 7.x-3.x
    Minor adjustment to submit button classes as accomplished by #2370417...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.