added js validation to input fields