抓住剃刀的价值

时间:2017-11-18 12:02:39

标签: javascript razor

我试着捕捉输入值,这是输入:

    <div class="form-group">
        @Html.LabelFor(model => model.Price_Selling, htmlAttributes: new { @class = "control-label col-md-2" })
        <div class="col-md-10">
            @Html.EditorFor(model => model.Price_Selling, new { htmlAttributes = new { @class = "form-control", @onkeyup = "CheckValue()" } })
            @Html.ValidationMessageFor(model => model.Price_Selling, "", new { @class = "text-danger" })
        </div>
    </div>

这是我的javaScript:

function CheckValue() {
    var pPrc = $('#Price_Selling').val() || 0;        

    alert(pPrc);
}

onkeyup只是没有回应。我有任何错误吗?如果它响应,我能得到正确的价值吗?

0 个答案:

没有答案