Welcome Guest, Not a member yet? Register   Sign In
Custom attributes with form_dropdown helper
#1

[eluser]iKode[/eluser]
Is there anyway to pass custom attributes to each option? Right now I get this output from a basic array
Code:
.
.
.
<optgroup label="Associate Degree">
   <option value="YA">Accounting</option>
   <option value="YK">Computer Information Systems</option>
   <option value="YC">Construction Management</option>
</optgroup>
<optgroup label="Career Certificate">
   <option value="LC">Civil Litigation</option>
   <option value="LB">Corporate Law</option>
</optgroup>
.
.
.

I would like this

Code:
.
.
.
<optgroup label="Associate Degree">
   <option value="YA" area_id="2" price="1234">Accounting</option>
   <option value="YK" area_id="5" price="1234">Computer Information Systems</option>
   <option value="YC" area_id="3" price="1234">Construction Management</option>
</optgroup>
<optgroup label="Career Certificate">
   <option value="LC" area_id="9" price="1234">Civil Litigation</option>
   <option value="LB" area_id="6" price="1234">Corporate Law</option>
</optgroup>
.
.
.

I wanted to create ONE dropdown with this information so I dont have to keep making ajax calls onchange to get the extra info I need.

Is there a way to do this with the current dropdown helper?
#2

[eluser]CroNiX[/eluser]
Unfortunately, no. You could probably easily extend it to do that though.




Theme © iAndrew 2016 - Forum software by © MyBB