Error handling in forms

Hi all,
I’m looking at error handling in forms for the Long Service Corporation portal. I want to make some improvements, but it would be helpful to get some documentation. Someone in Service NSW said it was best practice to highlight each individual field that has an error, and in addition to that, have the page automatically scroll to the top where the user sees an in-page alert that details each field that has an error. I can’t find any documentation to support that. Could anyone point me in the right direction or provide any more information on this pattern?

Hi @Timaurus,

Depending on the use case, it’s common to display both ‘In-line error messages’ and ‘Error summaries’ and the scroll to the summary is useful in terms of usability. However, for NSW government websites, the NSW DS currently supports only ‘In-line error messages’. We’ve added the evaluation of other methods to our backlog in response to recent requests for additional methods of displaying errors on forms.

It’s worth noting that:

  • ‘In-line error messages’ can be used independently,
  • ‘Error summaries’ should not replace ‘In-line error messages’ and cannot be used on their own.

You might also find this ‘Error message’ guidance document from the NSW GEL Library helpful (see image below).

Hopefully this helps, we’re always open to suggestions for improvement or any specific use cases you might want to share for us to consider better solutions.

Thanks for getting back to me on this, and apologise for the delayed response. This has been really helpful