js: Correctly update select items in forms

Fixes #7