I have a big form that is being validated on the server side. If the validation fails, then it will return all the errors that have occured.
So i want use a function as the :pattern method and want to check if the current field is in the errors. However, only the value is being passed to the function, so if i have to define a separate validation function for every input in the form. It would be handy is the name of the input would also be passed to the :pattern method so we can use one function to validate various fields.
I have a big form that is being validated on the server side. If the validation fails, then it will return all the errors that have occured.
So i want use a function as the :pattern method and want to check if the current field is in the errors. However, only the value is being passed to the function, so if i have to define a separate validation function for every input in the form. It would be handy is the name of the input would also be passed to the :pattern method so we can use one function to validate various fields.