Added optional validate function; defaults to form.valid if available.