set required attribute on validation element