update form with post method and added validation function