Validation gives "An error has occurred on saving"
- Single Page
Posted 05 July 2012 - 10:00 AM
I can't get any form of validation to work in my installaion of grocery CRUD.
required_fields, set_rules...
When adding/updating a record in the database it gives the error "An error has occurred on saving".
I have even tested to add just one line to the examples that was included in the package, with the same result.
Any idea what the problem could be? Any work-around?
function customers_management()
{
$crud = new grocery_CRUD();
$crud->set_table('customers');
$crud->columns('customerName','contactLastName','phone','city','country','salesRepEmployeeNumber','creditLimit');
$crud->display_as('salesRepEmployeeNumber','from Employeer')
->display_as('customerName','Name')
->display_as('contactLastName','Last Name');
$crud->set_subject('Customer');
[u][i][b]$crud->required_fields('contactLastName');[/b][/i][/u]
$crud->set_relation('salesRepEmployeeNumber','employees','{lastName} {firstName}');
$output = $crud->render();
$this->_example_output($output);
}
Posted 05 July 2012 - 10:22 AM
500 Internal Server Error
Posted 05 July 2012 - 10:43 AM
I found the reason when I was taken a closer look into Firebug-results.
The language files was not set up properly by me.
Now it works fine.
Posted 26 May 2014 - 17:50 PM
I'm getting same kind of issue. May I know how you solved it? I'm using the same code as you did. What was wrong in that code?