can we use jquery for client side validation of a custom validation control? -


There are textboxes for each other for email and I have used a custom verification control so that the user can access any ValidatePhoneEmail (source, args) {

  var tboxEmail = document.getElementById ('& lt; % = TboxEmail.ClientID% & gt; '); Var tboxPhone = document.getElementById ('& lt;% = tboxPhone.ClientID% & gt;'); If (tboxEmail.value.trim ()! = '' || tboxPhone.value.trim ()! = '') {Args.IsValid = true; } Else {args.IsValid = false;      

exact must use "required" on those areas, such as: < / P>
  $ (function () {$ ("form"). Validate ({Rule: {& lt;% = tboxEmail.UniqueID%>: "required", & lt;% = TboxPhone.UniqueID% & gt;: "required"}}})});  

If you want to add a custom message and agree that this is a valid email address, you can:

  $ ( {$ ("Form"). {Rules: {& lt;% = tboxEmail.UniqueID% & gt;: {Required: true, email: true}, & lt;% = tboxPhone.UniqueID% & gt; : "Required"}, Message: {& lt;% = tboxEmail UniqueID% & gt ;: "Please enter a valid email address", & lt;% = tboxPhone.UniqueID% & gt;: "Please enter a phone number Do "}});});  

Comments