FORMS

INTRO

FORMS application provides set of CSS stylesheets for compact forms definitions and also it provides database model for storing metadata information about documents, fields and validations.

#document { name = Name, sections = [ #sec { name=[<<"Input the password " "you have received by SMS"/utf8>>, nitro:to_list(Phone#phone.number)] } ], buttons = [ #but { name='decline', title=<<"Cancel"/utf8>>, class=cancel, postback={'CloseOpenedForm',Name} }, #but { name='proceed', title = <<"Proceed"/utf8>>, class = [button,sgreen], sources = [otp], postback = {'Spinner',{'OpenForm',Name}}}], fields = [ #field { name='otp', type=otp, title= <<"Password:"/utf8>>, labelClass=label, fieldClass=column3}]}.


SPEC

integer — Number.
money — Money with fixed point.
pay — Payment Method..
combo — General Combo Box.
select — Radio Button.
check — Checkbox.
string — Label control.
phone — Telephone Number with +.
auth — Credentials.
card — Credit Cards.
otp — One Time Password.
date — Datetime Picker.

DOCUMENT

-record(document, { ?ITERATOR(feed), name, base, sections, fields, buttons, access }).

FIELD

-record(field, { id, sec=1, name, pos, title, layout, visible=true, disabled=false, format="~w", curr=[], postfun=[], desc, wide=normal, type=binary, etc, labelClass=label, fieldClass=field, boxClass=box, access, tooltips=[], options=[], min=0, max=1000000, length=10, postback }).

SECTION

-record(sec, { id, name, desc="" }).

BUTTON

-record(but, { id, postback, name, title, sources=[], class }).

SELECTOR

-record(sel, { id, postback, name, title }).

OPTION

-record(opt, { id, postback, name, title, checked=false, disabled=false, noRadioButton=false }).

VALIDATION

-record(validation, { name, type, msg, extract = fun(X) -> X end, options=[], function, field={record,pos} }).