Hi, I'm trying to do some test with QuickForms and the easiest test didn't works.
I'm trying to insert a record in a database table when the submit button is pressed but I can't get it work.
The form is displayed on the screen and when I press the button, the form disappears, but the record didn't inserted in the database. The SQL code is ok, it works outside the form code.
This is my code:
public function formulario(){
$form = $this->init_module('Libs/QuickForm');
$form->addElement('text', 'vid', 'vlabel');
$form->addElement('submit','submit',__('Send'));
if ($form->validate()) {
DB::Execute('INSERT INTO acc_horas(ticket_id,id_user,hours) VALUES (11,22,33)');
}
$form->display();
}