client side validation and jquery tweaking