Check Input Field Value Javascript Array Sort