I have a form currently that contains a form group with the following code.
<div class="form-group">
<label>Role</label>
<div class="radio">
<label>
<input type="radio" name="role-options" id="role-foreman" value="Foreman" checked="">Foreman
</label>
</div>
<div class="radio">
<label>
<input type="radio" name="role-options" id="role-super" value="Superintendent">Superintendent
</label>
</div>
<div class="radio">
<label>
<input type="radio" name="role-options" id="role-admin" value="Superintendent">Admin
</label>
</div>
</div>
This all works as expected, but as soon as I add event handlers to the three inputs, I lose the default functionality of the form group, which is that when one radio button is pressed it becomes the only selected one.
Currently I have the following code in my event handler for the template.
"click #role-foreman": (e) ->
console.log e
showAddProjects = true
"click #role-super": (e) ->
console.log e
showAddProjects = false
"click #role-admin": (e) ->
console.log e
showAddProjects = false
What I am looking for is that the default behavior of the buttons remains, but then also run other code for when the button is pressed.