Commit ab4cd20d authored by Carsten  Rose's avatar Carsten Rose
Browse files

#3465 / Save button: optional 'active after form load'

Neu: Form.parameter.saveButtonActive - if this attribute is set, the save button will be enabled directly on form load.
Manual.rst: update doc
BuildFormBootstrap.php:: Add new attribute to 'form'-tag
parent 1b3f13e9
......@@ -1073,6 +1073,9 @@ parameter
| mode | string | The value `readonly` will activate a global readonly mode of the form - the user can't change any data. |
| | | See :ref:`form-mode-readonly` |
+--------------------------+--------+----------------------------------------------------------------------------------------------------------+
| saveButtonActive | - | Make the 'save'-button active on *Form* load (instead of waiting for the first user change) |
+--------------------------+--------+----------------------------------------------------------------------------------------------------------+
* Example:
......
......@@ -330,7 +330,9 @@ class BuildFormBootstrap extends AbstractBuildForm {
$attribute['class'] = 'form-horizontal';
$attribute['data-toggle'] = 'validator';
if (isset($this->formSpec[F_SAVE_BUTTON_ACTIVE])) {
$attribute[DATA_ENABLE_SAVE_BUTTON] = 'true';
}
return '<form ' . OnArray::toString($attribute, '=', ' ', "'") . '>';
}
......
......@@ -494,6 +494,8 @@ const DATA_TYPEAHEAD_SIP = 'data-typeahead-sip'; // Used for typeAhead
const CLASS_NOTE = 'qfq-note';
const DATA_ENABLE_SAVE_BUTTON = 'data-enable-save-button';
//const CLASS_TYPEAHEAD = 'qfq-type-ahead';
//const DATA_TYPEAHEAD_SIP = 'data-sip'; // Used for typeAhead
......@@ -583,6 +585,8 @@ const F_TYPEAHEAD_LDAP_SEARCH = 'typeAheadLdapSearch';
const F_MODE = 'mode';
const F_MODE_READONLY = 'readonly';
const F_SAVE_BUTTON_ACTIVE = 'saveButtonActive';
// FORM_ELEMENT_STATI
const FE_MODE_SHOW = 'show';
const FE_MODE_READONLY = 'readonly';
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment