问题描述:

I searched in net for text box validation where i have found so many jquery functions, i choosed a one and implemented and there the real problem began , it is not that much easy to implement first jquery plugin i think,,

<title></title>

<script type="text/javascript" src="Scripts/jquery-1.3.2.js"></script>

<script type="text/javascript" src="Scripts/jquery.validate.js"> </script>

<script type="text/javascript" src="Scripts/jquery.validate.min.js"></script>

</head>

<body>

<form id="form1" runat="server">

<h3 style="color:Olive">

ADD NEW USER BELOW

</h3>

<table>

<tr>

<td>

<asp:HiddenField ID="hdField" runat="server" />

</td>

</tr>

<tr>

<td style= " font-size:large">

Name:

</td>

<td>

<asp:TextBox ID="txtName" runat="server"></asp:TextBox>

</td>

</tr>

.

|

|

|

<tr>

<td>

<asp:Button ID="btnSave" runat="server" Text="Save" Width="46px"

OnClick="btnSave_Click" />

</td>

<td>

<asp:Button ID="btnCancel" runat="server" Text="Cancel" OnClick="btnCancel_Click" />

</td>

</tr>

</table>

and after the table design just before the tag i placed my jquery scripts which are:

 <script type="text/javascript">

$(document).ready(function({

$("#form1").validate({

rules:{

<%=txtName.UniqueID%>:{

required:true}

},

messages:{

<%=txtName.UniqueID%>:{

required:"This field is required"}

}

});

});

</script>

<script type="text/javascript">

jQuery.validator.setDefaults({

debug: true,

success: "valid"

}); ;

</script>

please anybody help me

相关阅读:
Top