CI & jQuery Linked dropdowns |
[eluser]edwin87[/eluser]
Hello CI, I was trying to add a jQuery linked dropdown script. See here In the example i was able to do some changes. But now add it to CI. I think it's wrong with the function that call's a url. This URL has without CI the script name. Like this: Quote:select.php So i think in CI it would be something like this : Quote:base_ur()/system/application/classname/function/value But there is no action at all. Code: $('#building').linkedSelect('<?php echo base_url();?>index.php/buildings/selectbox/building','#levels',{firstOption: 'Select a level'}); Can anyone help me with this? Thnx
[eluser]narkaT[/eluser]
according to your urls you have one controller named "buildings" containing a method "selectbox" which gets passed 1 parameter right? did you try opening these urls direkly via the browser? or looked hat the xhr-requests with firebug? maybe you misspelled something and CI cant find the controller/method.
[eluser]edwin87[/eluser]
Okay i forgot a parameter what is really stupid. Code: $('#building').linkedSelect('<?php echo base_url();?>index.php/buildings/selectbox/building','#levels',{firstOption: 'Select a level'}); It has to be something like this: Quote:classname/function/parameter1/parameter2 Parameter1 : Building Paramater2 : Id to search. But how can i fill parameter 2? The example script with php was: Code: <?php You can see it want to use 2 get vars. The first one i can fill. But the second one does not work.
[eluser]narkaT[/eluser]
get-parameters are not enabled by codeigniter by default. but you could rewrite the JS-part of that script to user segment based urls ![]()
[eluser]hvalente13[/eluser]
Hi edwin87, Did you get that working? If so, can you share the code? |
Welcome Guest, Not a member yet? Register Sign In |