Cell Validation Not working Properly

Tags: #<Tag:0x00007efc6cf379c8>

In My Example , I use Cell Validation. In case i mentioned required is false and Validator is given for any Numeric Cell.

My Problem is In case value is Null also checks the Validation and Showing Error. (required is false).

how to set the Validation if value is not null then only check the Validation (if required is false) else don’t check the validation

JSFiddle Example: https://jsfiddle.net/kranthi2210/o0zd3sew/10/

Hi @kranthikumar.reddy32

In the example you sent the validation is working correctly. You are checking if the value is smaller than 100 and greater than 10 and the null value here is treated as 0 and this is why you are getting the validation error.

Please find updated Demo.

condition1: ID Cell: required is true, value is null - Checking the Validation if text length Grater than 10 show Error less than 10 not shows Error. But In case Null also show Error because value is required.

Condition2:number Cell : if required is false, and value is null , check the Condition incase value Grater than 10 and less than 100 and shows Error. Here Dont show the Error because required is false. Checks only if value is Entered And Condition is passed

JSFiddle Example: https://jsfiddle.net/kranthi2210/o0zd3sew/37/

Hi @kranthikumar.reddy32

Thank you for an explanation. However it’s not entirely clear to me, so here’s the updated example:

https://jsfiddle.net/b46uhmwd/1/

Let me know if I understood the issue correctly and that’s your expected output.

HI Adrian,
Here 2 Conditions are there.
Condition1: Required false And some Validation is there. if i pass value is empty it shows error, Condition checks but not consider the cell is required or not.

Condition2: Required is true and some validation is there in case value is not passed shows error and value not pass the Conditions shows the Error. this is working perfectly.

Only Incase required false, value is empty in that case also check the Validation showing error Message.here Empty value is not allowing . please find demo for your reference.

https://jsfiddle.net/kranthi2210/o0zd3sew/54/

Hey @kranthikumar.reddy32

I read all the messages in this thread and I think that it will be easier for us to understand your requirement if you could take the latest @adrian.szymanski demo and specify WHAT to type in WHICH cell and WHAT outcome do you want to receive. Can you do that for us?

Hi Aleksandra,
In my case if i pass extra values along with value,callback and required and some parameters, my issue will be resolve. Based on that i prepare customvalidation. is it possible to send extra parameters on validation function.

Yes, here’s a topic on adding custom parameters to a validator https://stackoverflow.com/questions/48674426/is-there-a-way-to-pass-extra-parameters-to-handsontable-validator-functions

Hi Aleksandra,
Thanks for your reply. this.customparameter is working in my case.

Great. So I think that we can close the ticket as solved.