I am working on creating a custom validation rule for an array of inputs for an availability calendar. I have the custom validation all setup, the issue is when there is an error in the validation rule, I cannot figure out how to make it target the right element and highlight it, mainly because of the name of the array. It goes by the following convention for my example: 'availability.0'. The problem is, Jquery won't recognize the .0 as part of a valid name.
I am using AJAX to send the form data and when there is an error, it returns back this JSON data as an example
{"readyState":4,"responseText":"{\"availability.0\":[\"Time set is not
valid, please enter time in the following format 10:00AM-4:00PM. If you
have\\r\\n multiple blocks of time available in a day, separate by
comma in the following format 10:00am-12:00pm,2:00pm-4:00pm\"]}","responseJSON":
{"availability.0":["Time set is not valid, please enter time in the following
format 10:00AM-4:00PM. If you have\r\n multiple blocks of time
available in a day, separate by comma in the following format 10:00am-
12:00pm,2:00pm-4:00pm"]},"status":422,"statusText":"Unprocessable Entity"}
Here is a photo from JSONViewer showing multiple errors:
I can't figure out how to make this work, I can't add the .0 at the end of availability because Jquery doesn't recognize that as valid, but if I don't, then it's not the name of the array I need. I don't really know where to go from here.
