$form = new Barebone\Form();
$form->is_ajax();
if($form->is_send() && !$form->is_valid()){
$this->ShowZebraDialog('Error', 'Your form has an invalid seckey', 'error');
}
if($form->is_send() && $form->is_valid()){
$this->ShowModal('You send this data:', '<pre>'.print_r($_POST, true).'</pre>');
}
$form->secure_form();
$form->addInput('text', 'ID', 'id', ['disabled' => 'disabled', 'class' => 'form-control']);
$form->addInput('text', 'Name', 'name', ['class' => 'form-control']);
$form->addInput('text', 'State', 'state', ['class' => 'form-control']);
$options = [];
$options[0] = 'No choice made';
$options[1] = '1 choice made';
$options[2] = '2 choice made';
$form->addSelect(
label: 'Choices',
name:'choices',
attributes: ['class' => 'form-control'],
options: $options
);
$form->addButton('submit', 'Save', ['class'=>'btn btn-success', 'style'=>'margin-top: 20px;margin-left: 15px;']);
$this->view->form = $form;