BoldSignEasily embed eSignatures in your .NET applications. Free sandbox with native SDK available.
Hi Bharat,
Thanks for contacting the Syncfusion support.
Using the custom validation in jQuery, we can set the customized validation condition for Textbox. Please refer to the below code example to know how can we add the custom validation for Textbox. Using the addMethod, we can add custom validation in jQuery validator.
$("#Grid").ejGrid({ columns: [ { field: "CustomerID", headerText: 'Customer ID', width: 90, validationRules: { customRegex: " "} }, // Custom validation ] }); $.validator.addMethod("customRegex", function (value, element, params) { if (element.value.indexOf(params) == 0) return false; return true; }, "Contains the white sapce"); |
Please share the following details,
1. Do you want to check your validation condition before save action?
2. Want to display the validation message?
We have created a sample in jsplayground: Sample
Regards,
Isuriya R
Your requirement is achieved by using keyup event in Grid. We have used editFormValidate method to check validation condition and display the validation message.
<script> $(document).on("keyup","#GridEditForm input" ,function(evt){ if(evt.keyCode == 32){ var obj=$("#Grid").ejGrid("instance"); obj.editFormValidate(); } }) </script> |
We have also created a sample using keyup event in jsPlayground,
Sample: Sample
Regards,
Isuriya R