add a start option for dynamic drop down list
add a start option for dynamic drop down list
hanyelbana
Posts: 24Questions: 0Answers: 0
Hi,
I need to add a start option with null value to generated dropdown list like ( Please select country from the list ...)
editor.field('country_id').update( json.countries );
That will be good for validation and sometimes I need to let user to select null.
How can I add this option from the client code not from the database.
Thanks
I need to add a start option with null value to generated dropdown list like ( Please select country from the list ...)
editor.field('country_id').update( json.countries );
That will be good for validation and sometimes I need to let user to select null.
How can I add this option from the client code not from the database.
Thanks
This discussion has been closed.
Replies
[code]
json.countries.unshift( {
label: 'Please select country from the list...',
value: ''
} );
[/code]
Just before you call the update function.
Regards,
Allan