Test1Test2Test3I would like that the empty option had a value set to zero like this:Select an option/option>Test1Test2Test3Thanks"> Set empty option value to zero in a dynamic dropdown - Forums

Forums

Set empty option value to zero in a dynamic dropdown

fasenderos 06 Jan, 2015
Maybe a stupid question, but I can't find a solution.
I create a dynamic dropdown using the demo-dynamic-dropdown and it works fine, except for the "Empty Option"

<select name="test" id="test" size="0" class="form-control A" title="" style="" data-load-state="" data-tooltip="">
<option value="">Select an option/option>
<option value="1">Test1</option>
<option value="2">Test2</option>
<option value="3">Test3</option>
</select>

I would like that the empty option had a value set to zero like this:
<select name="test" id="test" size="0" class="form-control A" title="" style="" data-load-state="" data-tooltip="">
<option value="0">Select an option/option>
<option value="1">Test1</option>
<option value="2">Test2</option>
<option value="3">Test3</option>
</select>


Thanks
GreyHead 14 Jan, 2015
Hi fasenderos,

The 'empty option' doesn't have a value set, if you want a zero option then you'd have to customise the PHP that is returning the options list to include it.

Bob
This topic is locked and no more replies can be posted.