There should be an action to set the default value of a form element while the form is built. I will work on a patch and publish it here tomorrow.

Comments

klausi’s picture

Status: Active » Needs review
StatusFileSize
new2.97 KB

And here it is. Support for CCK fields is included, as they save #default_value as array.

fago’s picture

Looks good, a possibility to specify multiple default values (think of a multiple select, checkboxes) would be nice though.

klausi’s picture

StatusFileSize
new5.49 KB

New patch:
* removed some useless white spaces (coding style)
* multiple value support
* adapted CCK support to also allow multiple values

klausi’s picture

StatusFileSize
new5.39 KB

Some small fixes that shorten the action code, thx to fago for the review via Jabber.

fago’s picture

Cool that there is multiple value support now :) Also code looks fine (and did before), but now it's even a bit shorter!

klausi’s picture

Status: Needs review » Fixed

Committed to CVS.

Parkes Design’s picture

Awesome... this looks like a very useful patch.

Status: Fixed » Closed (fixed)
Issue tags: -gsoc:rulesmonkey

Automatically closed -- issue fixed for 2 weeks with no activity.