[drupal-devel] New themeable function for buttons?

neil at civicspacelabs.org neil at civicspacelabs.org
Thu Jul 7 08:33:42 UTC 2005


On Wed, Jul 06, 2005 at 04:08:09PM -0700, neil at civicspacelabs.org wrote:
> The use of HTML links, such as 'Cancel,' along side form_submit() will
> be more common in the future. I am planning on changing all the Delete
> buttons, which should go to a confirmation page, to links. I don't think
> that this has been fully documented, but I think it is an accepted de
> facto standard now. The main rule of thumb is that links should never
> change anything.

I was expecting (and hoping to avoid) some debate of the basic issue. I
certainly didn't expect this reaction.

I was sceptical of the links next to buttons idea at first. The reasons
that convinced me to approve of this approach are:
- Helped visually distinguish the actions. You probably want to click
  'Delete' rather than 'Cancel.'
- Buttons do POST and links do GET, which fits with what the respective
  actions actually did.

In my recent work trying to standardize on links for 'Delete' which go
to a confirmation page I found it was actually significantly easier to
do all the destination handling if I was doing links.

I did find one supporting weblog at
http://www.lukew.com/resources/articles/web_forms.html. You should
probably review his logic as well; it is near the bottom.

I wanted to do something really simple, but I think I need to bake the
concept of primary and secondary actions into a heavier API closer to
what Adrian suggested earlier in this thread. I'm don't think theme
control of something being a link or button is realistic, that is just
asking for problems to arise since the two have rather different
properties.

For the button vs. link debate for non-consequential secondary actions-
this seems like a holy war and the *only way* to resolve this issue once
and for all would be doing some user testing. Any volunteers for helping
design a test to get valid results and anyone willing to find and
provide incentive for test participants?

-Neil



More information about the drupal-devel mailing list