如果有值,我正在尝试验证文本框。此文本框位于用户控件中。
我试图调试我得到以下值。
input[id*=txtTitle]").val()
{"enabled":true,"emptyMessage":"","validationText":"","valueAsString":"","lastSetTextBoxValue":""}
如何验证此用户控件?请告诉我。
<script type="text/javascript">
$(document).ready(function () {
$("#<%=Button2.ClientID %>").click(function () {
var valid = true;
var msg = "Please fill form:\n";
if($("input[id*=txtTitle]").val().length == 0{
msg += "Title is Required!\n";
valid = false;
}
</script>
<uc1:TextBoxWithCount ID="txtTitle" runat="server" MaxLength="200" ></uc1:TextBoxWithCount>