Form item types

This page is Work in Progress! Keep following up...

Quanta allows using several default form types, each containing its specific rendering and validation criterias. 

The Input type is optional, and will default to "string" (text) if not specified, as in the above example.

Allowed input types are:

For better understanding see the method FormFactory::createInputItem.


LIST TYPES:


select

Used for choosing from a list of options, renders just as a standard HTML select.  
[INPUT|type=select|empty=Choose a fruit|name=fruit|values=Coconut,Mango,Pear]

Key-Value pairs in options can be separated, using the --- separator.
[INPUT|type=select|empty=Choose a fruit|name=fruit|values=coconut---Coconut,mango---Mango,pear---Pear]


Another way to fill options, is the {LIST_VALUES} qtag, allowing using a list of nodes as options.

Given this structure:

📂  fruits
  • 📁  orange
    • 📁  banana
      • 📁  apple

        We can build select options like in the following example:
        [INPUT|type=select|empty=Choose a fruit|name=fruit|values=apple---Apple,banana---Banana,orange---Orange]


        checkbox

        Used for choosing from a list of options, renders just as a standard single HTML checkbox.  

        [INPUT|type=checkbox|name= ox|title=Check here to confirm]


        TEXT TYPES


        string

        A basic string (text) input. 


        number

        A string input, limited to numbers (0-9)


        email

        A basic string (text) input representing an E-mail address. It will automatically include  a double level of validation (html5 + on-submit validation) 


        url

        A basic string (text) input representing an URL. It will support a double level of validation (html5 + on-submit validation) 

        [INPUT|type=url|label=Your website's URL|name=website]


        password

        A password text input
        [INPUT|type=password|label=Your password|name=password]


        OTHER:


        autocomplete

        A text item including an autocomplete widget.
        Will be discontinued soon in favor of an "autocomplete" attribute to be used in all input text types.


        date

        A date item - supports a date popup widget.


        time

        A time (in HH:mm format).


        file

        Used for file uploads. Supports Drag & Drop, and loading of multiple files altogether. Provides upload progress for all files being loaded.


        Only works in Shadow for now.


        hidden

        A hidden text input. 


        submit

        A submit button for the form