Thanks a ton for this trick, it worked great!
I took the liberty of mashing this function up with a Storm UK Gravity Forms select plugin, and made a Formidable Forms select plugin:
https://github.com/iamhexcoder/formidable_select
Just thought you’d like to know! Any feedback or issues, let me know.
Props given to @nicmare and @welaika in the README 😉