SiMan CMS
Home
Download
Install
Upgrade
News
CMF Demo
Code Generator
Donate
EN
UA
Home
Demos
UI Form - Form
UI Form - Form
Text field
Text field with calendar
Text field with phone mask XXX-XXX-XXXX
Text field with date mask mm/dd/yyyy
Select field
Label 1
Label 2
Label 3
Radio group field
Label 1
Label 2
Label 3
Textarea field
Custom value
Checkboxes
Checkbox 1
Checkbox 2 (label after control)
Checkbox 3 (custom value)
Separator
Editor
Some submit button note (optional)
Form without action and submission
Some Field
Code Example
sm_on_action('forms', function () { sm_title('UI Form - Form'); add_path_home(); add_path('Demos', 'index.php?m=demo'); add_path_current(); $values = Array( 'text' => 'Text', 'select' => 2, 'radio' => 2, 'checkbox1' => 1, 'checkbox3' => '+' ); $ui = new UI(); $f = new Form('index.php?m=demo&d=forms'); $f->AddText('text', 'Text field')->SetFocus(); $f->AddText('calendar', 'Text field with calendar')->Calendar(); $f->AddText('maskedinput1', 'Text field with phone mask XXX-XXX-XXXX') ->WithMask('999-999-9999'); $f->AddText('maskedinput2', 'Text field with date mask mm/dd/yyyy') ->WithMask('99/99/9999', 'mm/dd/yyyy'); $f->AddSelectVL('select', 'Select field', Array(1, 2, 3), Array('Label 1', 'Label 2', 'Label 3')); $f->AddRadioGroup('radio', 'Radio group field', [1, 2, 3], ['Label 1', 'Label 2', 'Label 3']); $f->AddTextarea('textarea', 'Textarea field'); $f->Separator('Checkboxes'); $f->AddCheckbox('checkbox1', 'Checkbox 1'); $f->AddCheckbox('checkbox2', 'Checkbox 2 (label after control)'); $f->LabelAfterControl(); $f->AddCheckbox('checkbox3', 'Checkbox 3 (custom value)', '+'); $f->Separator('Separator'); $f->AddEditor('editor', 'Editor'); $f->SetSaveButtonHelperText('Some submit button note (optional)'); $f->SaveButton('Custom Submit Button Title'); $f->LoadValuesArray($values); $f->SetValue('textarea', 'Custom value'); $ui->Add($f); $ui->h(2, 'Form without action and submission'); $f2=new Form(false); $f2->AddText('dummy_field', 'Some Field')->WithValue('Some value'); $ui->Add($f2); $ui->Output(true); });
News
Announcements
Releases
Updates
Other News
Ads