Passing data from View to Model (where --> from view input) - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Passing data from View to Model (where --> from view input) (/showthread.php?tid=59585) |
Passing data from View to Model (where --> from view input) - El Forum - 10-23-2013 [eluser]hrg.vincent[/eluser] //View Code: <input type="input" id="tcs_fname" name="tcs_fname" /> //Controller Code: public function getVisaStatus() //Model Code: function getVisaStatus($data) Anyone can help on how to pass data from View to Model as I need to get the where condition, data is from view input text. Passing data from View to Model (where --> from view input) - El Forum - 10-24-2013 [eluser]Tpojka[/eluser] Shouldn't it be: Code: <input type="text"> Input types. Passing data from View to Model (where --> from view input) - El Forum - 10-24-2013 [eluser]Ckirk[/eluser] Can you give us more info? You're not being clear in what you are trying to achieve. Any data in the view was put there by the application so it's already available to your model. and yes... input type="text" Passing data from View to Model (where --> from view input) - El Forum - 10-24-2013 [eluser]hrg.vincent[/eluser] I think is javascript problem because I used i to control. Code: function loadHomeFn(){ May I know how to passing data from javascript to controller? Passing data from View to Model (where --> from view input) - El Forum - 10-25-2013 [eluser]Ckirk[/eluser] To pass data to the controller you will use the GET or POST. same as you did with your loadHomeFn. Your controller will need to be able to handle the information being sent to it, of course. Passing data from View to Model (where --> from view input) - El Forum - 10-25-2013 [eluser]hrg.vincent[/eluser] I've change some of my code in controller, but still can't get the data from javascript. Code: public function getVisaStatus() Please help... |