CI/jQuery - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: CI/jQuery (/showthread.php?tid=18914) |
CI/jQuery - El Forum - 05-22-2009 [eluser]beasten[/eluser] Hi all, Im new here and at CodeIgniter. Im doin a little project and ran into som problems. Donno if this question is OK with you, it contains a little bit of jQuery too. I have a jQuery list (not really important if its jQ or not..) with "expenses", when I click one of my expenses theres a little dropdown-form (jQuery) with the values of my expense. (Its an economy project) My question is how do I get the value from my expense to be filled in to my form so that I can edit the expense? Ive tried the urisegment, tho I dont get it to work. Code Below. Thank you, Beasten Code: <div id="top10"> CI/jQuery - El Forum - 05-22-2009 [eluser]Thorpe Obazee[/eluser] i didn't read the problem or some of the code well. I have one comment though. Why are you loading the database class in the view? CI/jQuery - El Forum - 05-22-2009 [eluser]beasten[/eluser] Thats a mistake, missed it. ( beginner at this ) CI/jQuery - El Forum - 05-22-2009 [eluser]beasten[/eluser] Is there some other way than with urisegment? CI/jQuery - El Forum - 05-22-2009 [eluser]Dam1an[/eluser] You could have them passed into the controller as variables, and then pass them into the view CI/jQuery - El Forum - 05-22-2009 [eluser]beasten[/eluser] How do I pass them into the controller? CI/jQuery - El Forum - 05-22-2009 [eluser]Dam1an[/eluser] Its in the user guide CI/jQuery - El Forum - 05-22-2009 [eluser]boony[/eluser] Hi, I'm not sure if I understand your problem, but if you want to populate a drop down box with values from your database this should work. You should have a model, and in that model a function like this: Code: function drop_down_data() Now in your controller you should have something like this: Code: function get_drop_down_data() And in your view, make the form *NOTE* that I'm using the form helper here (have a look in the user guide) and you will need to do all the other stuff. But this will now give you a select with your values. Code: echo '<p>'. form_label('Some Name','your_field'); |