added front-end validation in jquery