Note: You are currently viewing documentation for Moodle 2.6. Up-to-date documentation for the latest stable version of Moodle may be available here: Button.

Development:Button: Difference between revisions

From MoodleDocs
mNo edit summary
Line 9: Line 9:
* Links take up less screen real estate than buttons
* Links take up less screen real estate than buttons
* Buttons should be preferred for (at least primary) commands
* Buttons should be preferred for (at least primary) commands
* A button is like a promise to the user that something will happen: the state of the application will change when the button is clicked. Buttons should not be used for navigation since that fails user expectations. When there is a link users can expect it to make sense to open it in a new tab, for instance.


== Solution ==
== Solution ==

Revision as of 19:37, 8 August 2009

Moodle User Interface Guidelines > Link

Note: This article is a work in progress. Please use the page comments or an appropriate moodle.org forum for any recommendations/suggestions for improvement.

This is a guideline for a Moodle Interface Guideline. Comments: developer forum thread


Problem

The user needs to be provided the choice to issue a command. This command may be to submit form data.

Forces: factors that affect selection

  • Links take up less screen real estate than buttons
  • Buttons should be preferred for (at least primary) commands
  • A button is like a promise to the user that something will happen: the state of the application will change when the button is clicked. Buttons should not be used for navigation since that fails user expectations. When there is a link users can expect it to make sense to open it in a new tab, for instance.

Solution

The label of a button should be a command verb: "Save Settings".

Buttons should never be used for navigation. Instead, use links.

With buttons, the command is usually mediated to the server in form of a POST parameter. Pressing the back button results the browser asking if the user wants to resubmit the form. To avoid this and keep the back button functional, redirect (using HTTP headers) the resulting page, to a new page after processing the data the browser sent.

Related guidelines

Related issues in the tracker

  • TODO: The course groups management UI uses buttons for navigation within the UI

Further information / Sources