Added JS to pick up required attribute on conditional fields