samedi 14 février 2015

Need to get a variable value from a view into my controller


I am very new to codeigniter and even though I have researched about how to get a variable from the view and pass it to my controller. I still not able to do it.


I have a form_input embedded in bootstrap and I use JavaScript to validate the field in my view but I need to get/pass that form_input value to my controller. How should I do that or what i am doing wrong. Thanks in advance for any help!


this code is from my controller:



else if($this->spw_user_model->isUserProfessor(getCurrentUserId($this)) && $input){

var_dump($this->input->get('email_address'));

$inputForm = json_decode($input);
$success = $this->spw_vm_request_model->updateRequestsFromProject($inputForm);
echo json_encode(array("success"=>$success));

}


this code id from my view:


basically, I load the view and when a button written in javascript is clicked the page should submit it functionality and the input filed should pass it values to the controller. I might have not explained everything 100 % but that is the idea> I don't know f the input field will be just working with a form_button but anyways I don't think that should be the case





Aucun commentaire:

Enregistrer un commentaire