Submit button
The form's primary action button, triggers validation, the save flow, and any onBeforeSave / onSave handlers.
The Submit button kicks off the form's save pipeline:
- Declarative validation, every field with a
required,pattern, orrequiredIfrule is checked. - Author validation,
onValidatehandlers (form-level and per-field) run. onBeforeSave, author hook fires; can callreturn { cancel: true }to abort.- Primary write, fields are mapped to SharePoint columns and the item is created/updated.
- Post-save writers, Signature, Attachments, Image, Taxonomy, LinkedList children are written in a follow-up phase.
onSave, final hook fires with the resulting item id.
A single form should have exactly one Submit button (use the
SubmitCancel pair for the standard submit + cancel layout).
Common properties
| Property | Description |
|---|---|
labelstring default: "Submit" | Button text. |
visibleIfexpression | Hide unless the expression returns true. Useful for wizard-style multi-page forms. |
enableIfexpression | Disable until the expression returns true. Use for client-side prerequisites that aren't expressible as field-level rules. |
Type-specific properties
| Property | Description |
|---|---|
variant"primary" | "danger" default: "primary" | Colour scheme. Use "danger" on destructive submits (e.g. a Cancel-Subscription form). |
size"sm" | "md" | "lg" default: "md" | Button size. |
busyLabelstring default: "Saving…" | Replacement label shown while the save flow is running. |
confirmMessagestring | If set, show a confirm dialog before submitting. Empty/missing means no prompt. |
JavaScript recipes
Pre-save side effects (audit trail)
f365.events.onBeforeSave(() => {
f365.field('LastModifiedBy').value = f365.user.current().email;
f365.field('LastModifiedOn').value = new Date().toISOString();
});
Cancel submit when a related check fails
f365.events.onBeforeSave(async () => {
const inStock = await f365.http.get<{ available: number }>(
`/api/inventory/${f365.field('Sku').value}`
);
if (inStock.available < Number(f365.field('Quantity').value)) {
f365.ui.showAlert('Not enough stock to fulfil this order.');
return { cancel: true };
}
});
Redirect after a successful save
f365.events.onSave(({ itemId }) => {
f365.nav.redirectAfterSave(`/Lists/Orders/DispForm.aspx?ID=${itemId}`);
});
Disable until the form is clean
// In the property panel:
// enableIf: AgreedToTerms === true AND TotalAmount > 0
Related
Related articles
- Cancel button
Discards unsaved changes and returns to the prior page, with a confirmation prompt if the form is dirty.
- SubmitCancel pair
The conventional "Submit + Cancel" button pair at the bottom of a form, paired layout with the right spacing built in.
- Save flow, what happens when the user clicks Submit
The two-phase save pipeline, validation, primary write, then post-save writers for attachments, signatures, images, and child rows.