Skip to content
This repository has been archived by the owner on Jan 10, 2022. It is now read-only.

Core library form

srsgores edited this page Dec 29, 2012 · 1 revision

Introduction

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

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

Creating a form, within your server-side javascript file, will involve the following steps:

  1. Create a form, from a javascript array {}.
  2. Assign form fields, each as its own object in the object array.
  3. Call render() using the renderer of choice on that array.
  4. Reference the form from a template file in your template.