Home show values entered in form as a table before getting submitted
 First, I do not have much talent in ajax so please consider that while answering. Here I want to get all the values which I inserted into the form in a table before getting submitted but unfortunately am not getting the results I want. So far I have done this. Please have a look.   Here I want to pass the values of form_data in to the table I had written and how can we pass that and did it compulsory to use the url in ajax while using this am getting an error like error: parsererror: SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data. Here is my controller public function ajax_data() { $array = array("agent_name" => "admin","number"=>"785","type"=>"super","quantity"=>"10");$data['json'] = $array; echo json_encode($data); }