We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

GridGroupingControl client side input fields validation

I have GridGroupingControl containing variable number of rows made of label and input fields (in other words 2 colons, 1st label and 2nd input field).
In order to continue with application execution, said input fields need to be checked if they are not empty.
This I want to happen on the client side.
I manage to do that via getElementById( GridGroupingControl ID+"some gibberish" ) and then array tags returned getElementsByTagName("input").
Input fields are created dynamically with know id prefix, so JS startsWith function comes in very handy.

My question is: Is there a way to do this kind of validation in more concise way?

Thank you & best regards.

3 Replies

PS Pavithra Subramaniyam Syncfusion Team May 24, 2019 05:03 AM

Hi Ivan,  
Thanks for contacting Syncfusion support. 
Before validating your query could you please share the below details that will be helpful for us to provide a better solution as early as possible 
  1. Share the type of edit Mode you are using. Please refer to the below demo for types of mode.
  1. Do you want to validate the inputs while initial rendering or editing?
Pavithra S. 

IC Ivan Crv May 28, 2019 03:07 AM

Hello again.
To help clarify I have added  file named gcc.png which contains screenshot of gcc in question. Said gcc is placed on the left hand side (columns "Name" and "Value") and contains 2 rows (2 input fields). Rows can be added(or removed) by using arrowed buttons. Hence arbitraty number of elements.

1)  It seems that is default editing mode made through code based on the data type (int, float, date etc.).
2)  I want validation if not empty to be done on button(e.g."Save") click after user is done inputing data on the client side.

Best regards.

Attachment: gcc_c8539eb8.rar

PS Pavithra Subramaniyam Syncfusion Team May 31, 2019 04:57 AM

Hi Ivan,  

Thanks for sharing the details with us. 

In our current architecture client side validation is not possible . we have to validate this on serve side event “CurrentRecordContextChange”.  

There is a newer alternative available. This suite of ASP.NET controls which was offered as “Essential Studio for ASP.NET ” till the Volumes 1 2019 release has been marked as “Classic” and the newer set of controls powered by Essential JavaScript1 and Essential JavaScript 2(ASP.NET with ES5) takes its place. The newer version provides several advantages over the classic edition including being purely client side rendered HTML5/JavaScript controls ,offers better performance and provides better support for touch interactivity. 

The newer version includes all the features that the classic version had so it should be easy to migrate if requires. The general guideline is that if you are using the classic edition of controls in existing products then you can continue to use them. However if you are starting a new project then it is recommended that you use the newer alternative available. Syncfusion will continue to maintain the support classic version of controls for several more years. We will also be happy to provide any required assistance in migrating from the classic edition . 

Pavithra S  

Live Chat Icon For mobile
Up arrow icon