Added required attribute to forms generation function.