08-20-2015, 02:31 AM
How can I add data attributes in the <option> tags using the form_dropdown() helper ? To generate something like this, for example:
PHP Code:
// the part that I'm interested is the [b]data-code[/b] attribute
<select class="form-control" name="country">
<option value="a" data-code="code1">itemOne</option>
<option value="b" data-code="code2">itemTwo</option>
<option value="c" data-code="code3">itemThree</option>
</select>