client side validation and jslint fixes