on a custom form, i'd like to have "add more" functionality apply to two or more fields.

such a thing exists in the poll module - in node/add/poll - where you can add "choice" and "vote count" simultaneously by hitting the "add another choice" button.

is there a guide somewhere on how you can implement this in a custom form of your own?

Comments

netron’s picture

i came across this guide here
http://www.nicklewis.org/node/967

but there seems to be elements in the solution that are missing.

is there anyone out there who has experience of having more than one field with an Ahah "add more" button, so that the two fields (or more) obtain a new line in a form in response to that "add more" button?

any guides, tutorials on how to implement it in your custom module?

netron’s picture

i guess i must be the only person in drupal doing this.

is there *anyone* out there who has managed to implement ahah multi-field rows in a custom form?

netron’s picture

netron’s picture

maybe i'm approaching this the wrong way... in D6 is it possible to group cck fields together in a group, so that they act as one when you hit the "add another" button?

netron’s picture

can anyone give us some pointers on how to do this? i'm due to show drupal to a client this week, and this "add another" functionality would wow the client over , and get another convert to drupal.

drupal version is 6.x

netron’s picture

bump.

can anyone give us some pointers?

timonweb’s picture

Looking for the same solution, netron! Did you find out how to do this?

zilla’s picture

in d6, my cck fields show an option to add more - unlimited (an 'add another' button) or a specific number (1 to 10)

you could simply add a cck field as the 'body' if that's what you're after and suppress the body (the default' body' ) by leaving that field blank - that will give you a subject field and a cck field (e.g. a multiline text field) with an 'unlimited' option - so what a user sees feels just like 'title and body' except that body is a cck field and they click 'add another' to add another body field and so on and so on

is this what you mean?

........................................................................
i love to waste time: http://twitter.com/passingnotes

mistresskim’s picture

You can create groups of fields and have them repeat with an Add More button using the new Content Multigroup module the CCK folk are developing at the moment. It's not completely ready for use on live sites yet, but it has the foundations of what you are looking for. Check the linked thread for the lowdown.