Drupal 5.x Form API: #value vs. #default_value

This is probably well documented if you look in the right place, but having just spent a number of hours puzzling through it on my own (despite) having access to documentation, I think it bears reiteration:

If you use '#value' when declaring a form element, that value is what will be received after submission, even if applied to a textfield that gets changed by the user. (This makes sense when passing a value behind the scenes, as you would do with a '#value' form element)

Use '#default_value' if you want the end-user to be able to modify the value.

Also

Tags

Syndicate content

Twitter

  • You can waste time with your friends once we reach our goal. #starwarspledgedrive 4 years 43 weeks ago
  • I find your lack of contributions disturbing. #starwarspledgedrive 4 years 43 weeks ago
  • Installing the Thawte CA Cert. in Plesk 8.6: http://helpdesk.netsonic.net/support/index.php?_m=knowledgebase&_a=viewa... 4 years 43 weeks ago
  • Protip to self: If you're going to tweet plesk advice, make sure you're looking at the right browser tab. Pls ignore previous tweet. 4 years 43 weeks ago
  • Plesk tip: if you're using the same dir for http & https, you need to use vhost_ssl.conf, not vhost.conf to do custom apache config. 4 years 43 weeks ago

Older

Contact

Andy Chase
(978) 297-6402
andychase [at] gmail.com
GPG/PGP Public Key