add required attributes to input