Hey i'm new to grocery crud,
I want to implement validation data on my add form
the form had multiple field :
company, address, city, state, country
when i type company name in the company field it will run validation to check wether the data is already in the database or not
if the data already exist then pop up the warning that the data is already exist, and if the data is not exist yet i can input the rest of the field
the code i'm trying to use to validate is
function validate() { $value = $this->input->get('value'); $data = $this->Company_model->get_company_by_companyname ($value); $result = array(); if($data) { $result['validate'] = 1; $result['url'] = site_url('company/edit/' . $data['id_company']); } else $result['validate'] = 0; echo json_encode($result); }