DmitryEfimenko / TwitterBootstrapMvc

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

Form submit at end of TextBoxFor #391

Closed profnimrod closed 9 years ago

profnimrod commented 9 years ago

Is there a way to add the form submit button to the end of the input box using TBSMVC, like in the example below:

capture

I have this so far:

@using (var f = Html.Bootstrap().Begin(new Form()))
{
    @f.FormGroup().TextBoxFor(x => x.SearchTerm).Placeholder("Zip or City").PrependIcon("fa fa-search fa-fw").Label().LabelText("")
}

I want to send the SearchTerm to another View ("SearchResults") when the "Go!" button is clicked.

Apologies for using "issues" so such questions.

DmitryEfimenko commented 9 years ago

Here is an example taken from BMVC Docs:

@(Html.Bootstrap().TextBoxFor(m => m.Amount)
    .Placeholder("amount in dollars")
    .Prepend("$")
    .Append(".00")
    .Append(Html.Bootstrap().Button().Text("Save")))
profnimrod commented 9 years ago

My goodness... How did I miss that example from the first page of the documentation!!?!?! Apologies for the oversight Dmitry and many thanks indeed for your rapid response.