Client side code for handling server side validation response