Option is not setting properly.
I have a select box
<select id="opentoall" name="opentoall">
<option selected="1" value="true">Public</option>
<option value="false">Viewers</option>
</select>
Now i am trying to set the select box using the following backbone code but it's not setting properly.
this.$el.html(this.template({
model: this.model.toJSON()
}));
this.$el.find('#opentoall').val(this.model.get('opentoall'));
i am not sure what i am missing....
Assuming your model's opentoall attribute is a boolean, you need to convert it to a string. Try:
this.$el.find('#opentoall').val(this.model.get('opentoall').toString());