I'm using codeigniter
and I have to use json
encode using jquery
and when I want to give the data and validate them I have problem.
My code is:
$this->load->library('form_validation');
$this->form_validation->set_error_delimiters('<div class="nNote nFailure hideit"><p>', '</p></div>');
$this->form_validation->set_rules('Name', 'Name', 'trim|required|xss_clean');
$this->form_validation->set_rules('Parent', 'Parent', 'required|xss_clean');
$this->form_validation->set_rules('Language', 'Language', 'required|xss_clean');
$this->form_validation->set_rules('Order', 'Order', 'required|xss_clean');
if ($this->form_validation->run())
{
//do something here
}
How should I handle the post request with JSON?