powmedia/backbone-forms — pull request #126 by torbjorntorbjorn (2012-09-20 11:45:17+00:00)
Title: Fields with options, such as Select, should handle 0 as value

Select and other editors dealing with lists take an options object that
define available choices.
The options object handles both HTML element value and the label.

This patch makes the editors handle integer 0 correctly as a value for
the list elements.

TL; DR:
```javascript
new editors.Select({
schema: { options: [
val: 0,
label: "I should have 0 as value"
]}
})
```

This doesn't work, the integer 0 is falsy, so it's doesn't get picked up.
The resulting
element will have a value attribute without a value,
making the value end up as "" when queried for in the DOM.