+1 on moving the error messaging to the server-side.