Fields

The w2form object uses w2field object for different field types. This object can also be used independently of the form. There are a number of field types the object supports. Below is an example of date and numbers fields

Example

HTML

Preview

- int
- float
- date
- color

Supported Types

clear removes any previous type
int integer
float float
hex hexdecimal
money number in money format
alphaNumeric alpha-numeric text
email email address
date date picker
list drop down list
select drop down list
color color picker
enum multi-select
upload file upload

Most field types are simple and require no additional parameters, however date, list, enum, etc. take extra options. Below is the list of options those fields take:

date: list or select: enum: upload: To send this additional options, you need to pass an object with properties when you initiate field:

Custom Types

If built-in types are not enough for you, there is a way you can create custom types. After you defined this type, you can apply it in the following way:

User Comments

comments powered by Disqus