fleja
fleja

Reputation: 25

How to remove selector from Html.TextBoxFor?

I have a little problem with Html.TextBoxFor. All i need is to remove the selector.

enter image description here

@Html.TextBoxFor(m => m.StartFund.Funds, new { id = "startFundsTextBox", @class = "k-textbox", @style = "width:20%; display:inline-block", @type = "number", @min = "0" })

Any clues?

Upvotes: 0

Views: 229

Answers (2)

4b0
4b0

Reputation: 22323

Using css you can remove spinners from input type number.

input[type=number]::-webkit-inner-spin-button, 
input[type=number]::-webkit-outer-spin-button { 
  -webkit-appearance: none; 
  margin: 0; 
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<input type='number' />

Upvotes: 1

Rhumborl
Rhumborl

Reputation: 16609

Remove the @type="number" attribute (and therefore also @min as it is now irrelevant):

@Html.TextBoxFor(m => m.StartFund.Funds, new { id = "startFundsTextBox", @class = "k-textbox", @style = "width:20%; display:inline-block" })

This makes it a normal textbox, rather than a numeric input.

Upvotes: 0

Related Questions