-
-
Notifications
You must be signed in to change notification settings - Fork 86
Form Properties and Buttons
TinaH edited this page Aug 27, 2021
·
2 revisions
// this page
public bool $showSave = true;
public bool $showDelete = true;
public bool $showReset = true;
public bool $showGoBack = true;
public string $saveStayBtnTxt;
public string $saveBackBtnTxt;
public string $onKeyDownEnter;
// see Field/Base Field/Validation
public bool $labelsAsAttributes = true;
// see form Data
public Model $model;
public array $form_data;
// see form Slots
public string $beforeFormView;
public string $headView;
public string $formTitle;
public string $formSubtitle;
public string $footerView;
public string $formFooterTitle;
public string $formFooterSubtitle;
public string $afterFormView;
// see form Styling
public bool $inline = true;
public string $inlineLabelAlignment;
public string $labelW;
public string $fieldW;
// see Wrapper Layout
public bool $wrapWithView = true;
public string $wrapViewPath;
public string $layout;
Override config, set the text for the Save and Stay
button.
Override config, set the text for the Save and Go Back
button.
Show the forms save button. See Form Methods page.
Show the forms delete button. See Form Methods page.
Show the forms reset button that automatically resets the form fields to the models initial value or each fields default value.
Show the forms save and go back button. Redirects the user to the previous page after the form is successfully submitted.
- Default: 'saveAndStay'
- Used for
wire:submit.prevent
on the<form>
tag, - Executes when the user hits the enter key, or clicks the submit button.
- Swap it to any other method you want to run when the form is submitted
Example
public function mount(?SomeModel $model)
{
$this->fill([
'onKeyDownEnter' => 'saveAndStay', //or any other component method, remove the line if you don't want any action at all
'showGoBack' => true,
'showReset' => true,
'showDelete' => false,
'saveStayBtnTxt' => 'Next >>',
'saveBackBtnTxt' => '<< Previous',
]);
$this->mount_form($model);
}
- Installation
- Requirements
- v5 Upgrade Guide
- v6 Upgrade Guide
- v7 Upgrade Guide
- Support
- Quickstart
- Manual installation
- Optional
- Form component
- Field
- Field types
- Example Form
- Blade Components
- Notifications