ASP.NET with C# and SQL SERVER , some vb.net . asp.net examples, asp.net codes, asp.net programs, c# code, sql server queries, important codes.
Thursday, 18 October 2012
custom validation with javascript in asp.net c#
<script type="text/javascript">
function ChkPcode(source,arguments)
{
var tb=document.getElementById('txtplancode');
var rvalue=PlanMaster.GetPCode(arguments.Value);
if(rvalue.value=="")
{ arguments.IsValid=true; }
else
{ tb.value=""; arguments.IsValid=false; document.getElementById('planCdCV').innerHTML="Plan Code Already Exists"; }
}
</script>
<asp:CustomValidator ID="planCdCV" runat="server" ErrorMessage="" SetFocusOnError="true"
ControlToValidate="txtplancode" Display="Dynamic" ClientValidationFunction="ChkPcode" ValidateEmptyText="True"></asp:CustomValidator>
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment