-
Notifications
You must be signed in to change notification settings - Fork 307
Core library form
Calipso contains helpers for creating common form elements. At the core, these elements rely heavily on the browser's ability to render HTML5 tags. With this in mind, you will need to make sure your browser supports these features (IE6-8 should consider upgrading to Chrome).
Forms are created within a server-side javascript file, and sent to the client. Each form will include a legend, indicating what kind of data the form will contain, as well as groups of labels and fields.
Input fields should be typed using the HTML5 current document standards, as defined by the W3C. Please refrain from using the default text renderer when possible (ex. type = text
); instead, use type = "email"
, type = "url"
, and pattern
when possible to avoid client-side scripting.
Creating a form, within your server-side javascript file, will involve the following steps:
- Create a form, from a javascript array
{}
. - Assign form fields, each as its own object in the object array.
- Call
render()
using the renderer of choice on that array. - Reference the form from a template file in your template.