finishing check length of input by javascript