Agaric Design Collective

FormsAPI

For usability, Drupal should focus on the first relevant form field

For a basic, but nice, usability improvement Drupal, for all pages where a form is the center of attention, the first form field that people should type in should have the keyboard focus given to it.

Here's a method for doing it with JQuery: http://www.gerd-riesselmann.net/development/focus-first-form-field-with-...

 

File uploads and Drupal 5 forms

sudo svn commit -m "uploading images will work so much better with the enctype set"

 

Fieldsets in Drupal forms: FAPI 5 syntax

Drupal fieldsets can also have a description.

<?php
$form['placement_imagecache'] = array(
'#type' => 'fieldset',
'#title' => t('Imagecache settings per content type'),

 

Multiselect forms with Drupal 5's FAPI

I always have to look this up, so here it is. Two examples for the price of one. Oh, and a link to the official Drupal 5 form documentation.

<?php
/**
* Implementation of hook_form_alter
*/
function term_message_form_alter($form_id, &$form) {
switch ($form_id) {