Allowing display of required fields and custom styling of them

Fixed issue with Logic

Use underscore indexOf for IE<8 compatibility