SebTags 1.0 Documentation: Basics

Basics

The cf_sebForm custom tag set creates a basic HTML form.

Here is a simple example of using cf_sebForm:

<cf_sebForm>
   <cf_sebField name="fName" label="First Name">
   <cf_sebField name="lName" label="Last Name">
   <cf_sebField name="bdate" label="Birth Date">
   <cf_sebField type="submit" label="Save">
</cf_sebForm>

This is a simple form that doesn't (as yet) perform any function. It has three optional text fields with no limit on length.

If I want to limit the allowable length on a field, I would add a "Length" attribute. For example, to limit the fname field to 40 characters:

<cf_sebField name="fName" label="First Name" Length="40">

If I want to make a field required, I add a required attribute with a value of true. This will add both a clients-side check with JavaScript as well as server-side validation. To make the last name required, for example:

<cf_sebField name="lName" label="Last Name" required="true">

I can also change the field type by adding a type attribute. For example, I can use a "date" type for bdate:

<cf_sebField name="bdate" label="Birth Date" type="date">

This will indicate that the field is a date field and add date validation for the field. Types of "date2" and "xdate" are also available (A link to a full list of is at the end of this entry).

Both cf_sebForm and cf_sebField can take any HTML attributes. For a full list of available field types (and information on creating custom types), see the cf_sebField section.