【发布时间】:2016-07-11 08:26:18
【问题描述】:
大家好,如何在 cshtml 中更改文本框的颜色?我有这个代码
$("#BUTTON").click(function (event) {
var urlPA = URL;
var crty = $("#Courtesy").val();
var fname = $("#Familyname").val();
var gname = $("#GivenName").val();
if (crty != 0 && fname != 0 && gname != 0) {
$.ajax({
type: "GET",
url: urlPA,
data: 'DATA',
success: function (response) {
alert(response);
/// when success the color of the textbox return to normal
},
datatype: "text"
});
} else { alert("Please fill up the required fields.");
////// when error the textbox background makes red
}
});
怎么做?谢谢。
【问题讨论】:
-
@GiladGreen 与众不同。我有一个条件,文本框是否会改变颜色。请参阅代码示例。
标签: javascript jquery html jqgrid-asp.net