Is it possible to loop through each input and see if a specific border color exists ?
Currently I'm using a keyup event that triggers an ajax request to validate form input. That works well and if an error is noted the input has a style applied:
'border': '1pt solid #ff00ff', 'color': '#ff00ff'}
I also add an error message to a status DIV. What I need to do is clear the status but on when all errors have been addressed. As each error is cleared the color is removed from the border.
I have tried counting the errors and storing the count in localstorage, but if the user keeps entering a valid value in a field, the count is decreased which results in the status being cleared when it shouldn't be.
So can I check any input where the name starts with name
, id
or cell
and if any have the border color #ff00ff
then keep the status message otherwise remove the message from #status
?
Thanks