2017-09-05 60 views
0

我有一个Html.TextBoxFor的小问题。我需要的是删除选择器。如何从Html.TextBoxFor中删除选择器?

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" }) 

任何线索?

回答

1

使用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' />

+0

就是这样!非常感谢你:) – fleja

+0

很高兴帮助.Up投票并接受答案。快乐的编码。 :) –

0

卸下@type="number"属性(因此也@min因为它是现在无关):

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

这使得正常的文本框,而不是一个数字输入。

+0

THX为ü回答,但我想和@类型=“数字”,只有删除选择。 – fleja