validate posts client side and server side