API reference
A few lines of markup render a fully functional, model generated form in a Topincs HTML service. This works for creating or editing a topic, e.g. for a contact form, and for a service form. Both forms are included by using the HTML custom components topic-form and service-form
The topic form creates or edits a topic. Data submitted is persisted in the database according to the model. There is a standard response that the administrator has no control over.
<topic-form type="1796"></topic-form>
API reference
API reference
// Markup
<topic-form
type="movie" view="787"
placeholders skin="simple"
ok-label="Save" cancel-label="Rather not"
onsuccess="movieSaved">
</topic-form>
// JavaScript
window.movieSaved = function() {
// Deactivate the form
this.setAttribute("readonly", "");
// Print success message.
showMessage("Thank you!");
}
The service form collects parameters and submits them to the service. What happens with the submitted data and the response is completely under control of the administrator.
<service-form service="some-service"></service-form>
API reference
// Markup
<service-form
service="setup"
placeholders silent
skin="simple" ok-label="Request activation code"
onsuccess="setupSuccess">
</service-form>
// JavaScript
function setupSuccess(value) {
// Remove the form.
// Process the body of the service response (= value).
}
This page cannot be displayed in your browser. Use Firefox, Opera, Safari, or Chrome instead.
Saving …