Input Validation Not Fulfilled: Accessing it through JS Code?

Hi all!
I'm trying to perform custom operations within JavaScript code, and for that, I need to be able to determine if individual fields of my Form are valid or not.
Is there a function that allows to have a return statement with a list of the fields/inputs that are not valid inside a form? I know that there's the function .validate() to see if the form as a whole passed all validation rules, but I need more specificity.

Just to clarify, are you looking for a function that returns a list/array of every component in a Form Retool Component that is invalid? if so, the answer is "no", there is not a built-in way to retrieve the exact components that failed validation..... however, there is a possible way to implement this using javascript, but you do have to define your 'validation conditions' in code as opposed to in the Retool GUI. you'll most likely want to put this code in the OnChange (or equivilant) event handler for the form

Hello @sidetool,

We currently have a feature request for this! I can add on this post to that and give the ticket a +1 for you.

The current work around would be something along the lines of what @bobthebear suggested.

You could use JS to iterate through or grab all the input components in a form, and then check which of their component states has .invalid === true