Validating IDs before form submission