DmitryEfimenko / TwitterBootstrapMvc

Fluent implementation of ASP.NET-MVC HTML helpers for Twitter Bootstrap.
Apache License 2.0
224 stars 79 forks source link

Multiple SubmitButtons inside ButtonGroup? #407

Open profnimrod opened 8 years ago

profnimrod commented 8 years ago

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.

DmitryEfimenko commented 8 years ago

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

profnimrod commented 8 years ago

That should work... would be nice not to have to do that tho ;-)