TwitterBootstrapMvc
TwitterBootstrapMvc copied to clipboard
Multiple SubmitButtons inside ButtonGroup?
I have a form where I'd like to have 3 grouped SubmitButtons for 'Create', Update' and 'Delete', but ButtonGroup does not seem to support SubmitButtons. Any ideas?
This works:
<div class="btn-group">
@Html.Bootstrap().SubmitButton().Style(ButtonStyle.Success).Text(null).PrependIcon(new Icon("fa fa-cloud-upload fa-fw")).Text("Create").HtmlAttributes(new { @name = "action", @value = "create" })
@Html.Bootstrap().SubmitButton().Style(ButtonStyle.Primary).Text(null).PrependIcon(new Icon("fa fa-retweet fa-fw")).Text("Update").HtmlAttributes(new { @name = "action", @value = "update" })
@Html.Bootstrap().SubmitButton().Style(ButtonStyle.Danger).Text(null).PrependIcon(new Icon("fa fa-trash-o fa-fw")).Text("Delete").HtmlAttributes(new { @name = "action", @value = "delete" })
</div>
But it would be better to be able to used to ButtonGroup functionality.
The only difference between a .Button and a .SubmitButton is button's type. You could try using .button and override it's type via .HtmlAttributes
That should work... would be nice not to have to do that tho ;-)