![]() |
drop down dependen from one to many and many to many table. - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24) +--- Thread: drop down dependen from one to many and many to many table. (/showthread.php?tid=71254) |
drop down dependen from one to many and many to many table. - monperiabras - 07-23-2018 I am having a hard time figuring out how to make a make a drop down dependency(payment terms base on selected class name), when you select the name class in the selectbox the select box generate a payment terms option base on the class select box base on the sql table (see last table). I think there is something wrong with my java script and CI model. I am very new in codeigniter activerecord, Please help me with my concern and Thank you very much in advance CLASS TABLE Code: classes PAYMENT TERMS TABLE Code: payment_terms ACADEMIC YEAR TABLE PHP Code: academic_year ACADEMIC YEAR AND PAYMENT TERMS TABLE Code: academic_year_payment_terms ACADEMIC YEAR PAYMENT TERMS AND CLASS TABLE Code: academic_year_payment_terms_class My Codeigniter View PHP Code: <div class="form-group"> My JavaScript Code: <script type="text/javascript"> My Controller PHP Code: function fetchPaymentTermsByClass() { My model PHP Code: public function getPaymentTermsByClass($classid){ RE: drop down dependen from one to many and many to many table. - Pertti - 07-23-2018 The JS part in your original post is cut off, and you never posted your model code (unless it came after JS). You can use php and code tags in Preview post to better format your code for others to read and make sure things don't get cut off. RE: drop down dependen from one to many and many to many table. - monperiabras - 07-23-2018 (07-23-2018, 06:54 AM)Pertti Wrote: The JS part in your original post is cut off, and you never posted your model code (unless it came after JS). You can use php and code tags in Preview post to better format your code for others to read and make sure things don't get cut off. Thank you very much for notifying me about the missing codes i have updated my post and I include the javascript, controller and model. hope you can help me with my concern. Than you very much in advance. |