Skip to content

CSS Support for Submit Buttons in Forms #331

@hfr

Description

@hfr

I suggest the following patch to the fieldsubmit module:

--- a/helper/fieldsubmit.php    Wed Jan 31 18:55:50 2024 +0100
+++ b/helper/fieldsubmit.php    Wed Jan 31 18:56:32 2024 +0100
@@ -44,6 +44,9 @@
         if(isset($this->opt['id'])) {
             $attr['id'] = $this->opt['id'];
         }
+        if(isset($this->opt['class'])) {
+            $attr['class'] = $this->opt['class'];
+        }
         $this->tpl = form_makeButton('submit','', '@@DISPLAY|' . $this->getLang('submit') . '@@', $attr);
         parent::renderfield($params, $form, $formid);
     }

It simply makes sure that any ".class_name" given in the submit line actually will propagate to the generated button.

In this way it is possible to format the form buttons.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions