我有一個Html.TextBoxFor的小問題。我需要的是刪除選擇器。如何從Html.TextBoxFor中刪除選擇器?
@Html.TextBoxFor(m => m.StartFund.Funds, new { id = "startFundsTextBox", @class = "k-textbox", @style = "width:20%; display:inline-block", @type = "number", @min = "0" })
任何線索?
我有一個Html.TextBoxFor的小問題。我需要的是刪除選擇器。如何從Html.TextBoxFor中刪除選擇器?
@Html.TextBoxFor(m => m.StartFund.Funds, new { id = "startFundsTextBox", @class = "k-textbox", @style = "width:20%; display:inline-block", @type = "number", @min = "0" })
任何線索?
使用css
您可以從輸入類型編號中刪除旋鈕。
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' />
卸下@type="number"
屬性(因此也@min
因爲它是現在無關):
@Html.TextBoxFor(m => m.StartFund.Funds, new { id = "startFundsTextBox", @class = "k-textbox", @style = "width:20%; display:inline-block" })
這使得正常的文本框,而不是一個數字輸入。
THX爲ü回答,但我想和@類型=「數字」,只有刪除選擇。 – fleja
就是這樣!非常感謝你:) – fleja
很高興幫助.Up投票並接受答案。快樂的編碼。 :) –