ivaynberg/select2 — pull request #2683 by ichinco (2014-09-13 13:13:48+00:00)
Title: update value of hidden input on init for single select

I believe I had the same problem as @hgpb at the very bottom of #1339.

Basically, the initial value of a single select never gets set in the hidden field. So if someone submits the form without changing from the initial, we get an empty value back.

I think this is because val, which updates the value of the hidden input field, is never called during initSelection. Since val calls updateSelection, I believe it could be as simple as replacing updateSelection with val.

At least, it fixes the problem for me!