to check and submit the form via html tag or ajax