added js valiations for posts and comments