updating validate and submit functions for HTML tables