I\'m having this issue with my code. whenever i submit the data, the error function is called but the data is still submitted correctly. what could be wrong
$