Skip to main content

CotomyForm

Abstract base class for Cotomy-managed forms. Calling initialize() wires a submit handler that prevents the browser's default submission and propagation, then calls submitAsync(). Using CotomyForm therefore means that Cotomy controls the form's submission.

Ordinary HTML GET and POST forms do not need CotomyForm. Leave them as native <form> elements when standard browser submission and page navigation are the desired behavior.

Properties

PropertyTypeDescription
actionUrlstringForm action URL (defaults to current path + query).
autoReloadbooleanWhether the form reloads on page restoration.
initializedbooleantrue after event handlers are wired.

Methods

MethodDescription
generateId(prefix?)Ensures the form has an id.
reloadAsync()Reloads the page (uses CotomyWindow).
initialize()Wires submit handler and marks the form as initialized.
submitAsync()Abstract method implemented by subclasses to perform submission under Cotomy's control.