Advanced Settings (recommended):
Available Types:
- text
- tel
- url
- number
addField([ 'type'=>'text', //required 'attributes'=>'', //optional 'name'=>'', //optional (leave empty if you don't want to submit the value) 'value'=>'', //optional (predefined value) 'placeholder'=>'', //optional 'label'=>'Information Text', //required 'id'=>'', //optional (name becomes the id by default) 'style'=>'', //optional 'class'=>'', //optional 'blockClass'=>'', //optional (class for the container) 'blockStyle'=>'', //optional (style for the container) 'dataString'=>'data-test="value"', //optional (full data attribute and value) ]);
Quick Mode:
addField('text', 'Label', 'DB Column Name','Input Value');
//example: addField("text","Last Name","LNAME",$db_items->result(0,"LNAME"));
Current Core clarification — Client Categories
name is the database column submitted by the form. Although optional for a non-persisted display input, it must be set for a field that should be saved. Use the database column required by your form. Add required and maxlength attributes only when appropriate for the field and its actual database schema. Array definitions and the shown legacy positional syntax both remain supported.