Update \Element::set_validation() to set required attribute if validation requires