Form Builder
Setting Up the Form
import Form from "@/templates/views/blocks/Form";contact({ http, services, helper, context }) {
const { view, item } = this.layout(Form, {
action: "#contact",
method: "post",
ingress: {
headline: "Contact us",
content: "Lorem ipsum dolor"
}
});
item.setFields({
firstname: {
type: "text",
label: "First name",
conAttr: {
class: "grow"
}
},
lastname: {
type: "text",
label: "Last name",
conAttr: {
class: "grow"
}
},
message: {
type: "textarea",
label: "Message",
},
custom: {
label: "Contact information",
type: "group",
fields: {
email: {
type: "text",
label: "E-mail",
attr: {
type: "email"
}
},
phone: {
type: "text",
label: "Phone",
attr: {
type: "tel"
}
}
},
config: {
// Recommended configs
nestedNames: true,
controls: true
}
},
submit: {
type: "submit",
value: "Send"
}
});
return this;
}Adding the Submit Page
Controller
Router
Available Form Fields
Form Field Settings
Adding Template Blocks in Form
Last updated