What do we need to mark fields as optional or required in a form? Are there any advantages or disadvantages? Since a user expects to fill all fields in a form, they'll anyway fill the optional fields too if they are not explicitly marked.
True, if there aren't optional fields marked they'll fill in everything. But some users may not want to fill in all of the extra fluff information if they don't believe you need it. There've been plenty of times when I started to sign up for a website, was asked for my home address or other personal information I believed the website had no need for, and immediately closed the tab. If you can set those fields as optional, you may have a larger number of users willing to sign up for the site.
If is required mark is then with sign * and with slightly background color mark this field.
If failed, marked it with red color and text message with red or lighten red color with moderate red color background.
RED COLOR = WARNING MESSAGE or FAILED (text + field) If is color both on text + field than background should be lighten red on red color warning text.
Field which is required should be sign with *, and if someone not insert and skip field which is required than should color with red for forgiven fields inputs.