implementing javascript for client side value change