Check for empty string client-side and server-side, improve char counter