Los formularios (FORMs) con sus campos (FIELDS) permiten mostrar y manipular una tabla del modelo de datos (o parte de ella). También pueden ejecutar acciones a través de eventos (EVENTS) o de botones (BUTTONS).
Sus atributos son:
<form id="frm_sample" source="people" caption="Sample Form"> <orderby>name</orderby> <fields> <key source="pk"/> <field source="name" caption="Name" type="string" len="40" maxlen="80" msg="Name empty"/> <string source="addr" caption="Address" len="40" maxlen="180" canbenull="Y"> <defvalue>This is a default value...</defvalue> </string> <int source="age" caption="Age" len="3" maxlen="3" msg="Invalid age"> <colfunc>MAX</colfunc> </int> <float source="height" caption="Height" len="5" maxlen="5" msg="Invalid height"/> <date source="bdate" caption="Birth day" msg="The Birth date is invalid" /> <time source="ctime" caption="Current time" canbenull="N" msg="Incorrect ctime"/> <string source="tstamp" caption="Time Stamp" canbenull="Y" msg="Invalid TimeStamp"> <defvalue>=date("Y-m-d H:i:s")</defvalue> </string> <text source="remarks" caption="Remarks" canbenull="Y" width="40" height="30"/> </fields> <events> <beforedelete> <action type="php"> <code>return 0;<code> <msg>You can not delete this field</msg> </action> </beforedelete> </events> <buttons> <action type="php" caption="PHP code"> <tooltip>Press here to launch a php function</tooltip> <code>MyPHPFunc();<code> <msg>Are you sure make this test ?</msg> </action> </buttons> </form>
<!ELEMENT form (doc?,datasource?,filter?,orderby?,theme?,help?,fields,events?,buttons?,acl?)> <!ATTLIST form id ID #REQUIRED source CDATA '' caption CDATA #REQUIRED tooltip CDATA '' >