Check Input Field Value Javascript Array Splice Index