"Multiple values" > more fields upon Preview

Events happening in the community are now at Drupal community events on www.drupal.org.
wmostrey's picture

I currently have a widget that provides a textfield and that supports multiple values: when a user submits his node and edits it again, 3 extra text fields are presented. I based hook_widget on nodereference for this.

What I'm trying to accomplish now is to provide the extra fields after a user hits the Preview button, instead of having to Save and Edit. As far as I see the issue is that on $op == "form" the $items variable is empty or doesn't update with the new values unless you submit the form; it doesn't update on Preview. How is this normally handled? Is this possible?

Comments

not sure...

niklp's picture

but I think that you will need to do a node_save in order for the table to be populated, which in turn the multiple field thingy will detect when you then proceed to edit the node again, ie it will see that the 3 existing values are filled, and add some more.

I guess there is probably a way round that, but I wouldn't know where to start I'm afraid. Possibly "module" and "form.api" are two phrases that I could throw at you, but that's yer lot! :p

Content Construction Kit (CCK)

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: