A form layout is used to display field values of a record. Refer to the myPass Widgets and UI Patterns for other myPass User Interface Guidelines.
Form references:
Depending on the situation, there are four styles of hint/informational messages that could be used on a form to provide user with additional information on a field.
aria-required="true"
Client side validation (missing required fields, format error, out of range) should be utilized to inform user of form field errors before the request gets submitted. Ideally, client side validation should happen either immediately after user entered a value on a field and moved away from the field (preferred), OR after user hit the Submit button (and before the request is sent to the server).
This image shows an example of a part of a form that is asking for two attributes. In this example, the Email Address data element has a client side validation to check the email address format.
The image shows how myPass will display a validation error that was detected clients side (actual implementation may vary – the main requirement is that the field is clearly highlighted in an Error font & background shade, and a clear message is provided to inform the user what the problem is):
Below is some common error messages:
Error Type | Message |
---|---|
User did not enter a required field | This field is required. |
User entered an incorrect format for a field | Please provide a {field} in the format: {format}. e.g. “Please provide a date in the format: MM/DD/YYYY” e.g. “Please provide an email in the format: @._” e.g. “Please provide a phone in the format: (xxx) xxx-xxxx” Note: When possible, be forgiving on the format; e.g. let user enter phone number as xxx-xxxxxxx or xxxxxxxxxxx or (xxx) xxx-xxxx. |
User entered the wrong data type (e.g. they enter an alphabetical string instead of a number) | Please enter a {type}. e.g. “Please enter a number” e.g. “Please enter a date” |
User entered a value out of range | Please enter a value between {min} and {max}. |
User enters an invalid date range | Please enter a start date that is earlier than the end date. |
If user attempts to leave the form without saving (e.g. by closing the browser, or entering a new URL, etc.), a confirmation dialog with 2 options (a Yes option and a No option) will be shown first; clicking the Yes option closes the dialog and user will proceed to leave the page with their progress abandoned; clicking the No option closes the dialog with no change.
To prevent a form from being submitted more than once in error, after a user click on a submission button on a form, all submission buttons currently presented on screen should be disabled (either by disabling the buttons (preferred) or taking user to an interim 'loading' state where no other submissions can be made). This will prevent user from performing any other submission until the current submission has been completed.
Once the submission is completed (regardless of whether it was a successful submission, or an error has occurred), user should be free to perform submissions/actions again.
Buttons on html forms on pages should be left aligned to the input elements, with the primary button being the left-most button.
There are some rare exceptions to the primary button being the left most buttons, e.g. [Yes]/[No] buttons where the primary button may be [No], or [Back]/[Next] buttons where the primary button is [Next]. These exceptions should only occur if switching the order breaks the conventional reading order that user is familiar with (e.g. user generally expects to see [Back] before [Next], [OK] before [Cancel], [Yes] before [No], etc)
Buttons on html forms on dialog boxes should be right aligned of the form’s width, with the primary button being the left-most button.
If the dialog box is wide, the form’s width should be relatively contained to avoid too much whitespace between the buttons and the field elements.
The button that represents the primary action should be styled as a Bootstrap Primary button and the other buttons should be styled as Default.
The button labels should be written, whenever possible, as an action and using “title case”. E.g “Delete the Connection”.
http://www.grammar-monster.com/lessons/capital_letters_title_case.htm
When a user attempts to save a form that PASI Core indicates is an Empty Update then display a Warning Message with the following text:
English: "There was nothing to update since you did not change any of the values."
Note: This could be done as a client side validation or as a server side validation. Client side is preferred. When a user attempts to save a form that PASI Core indicates is a successful update then display a Success Message with the following text:
English: "Save successful."
Messages should be displayed in the manner described in Error / Message placements
As a general guideline, a success, failure or warning message should be displayed to user when they submit a form so that the user is aware of what happened with the submission.