matrix form validator implemented with jquery functions