Ok I've been searching around all morning on this one and there doesn't seem to be a good solution, but I'm putting a call out for advice on how to get this going.

Basically I want a dropdown list in the form that lists all node titles of a specific node type. (This needs to be dynamically generated and not hard coded as new nodes will be added or deleted later)

Depending on the selection made in the first select box I need to pull in all the nodes of second node type that contain the first selection as a node reference into a second selection box.

For example the first select box may be a list of Movies and then the second select box would be a list of session times that movie is playing.

I'm assuming I may have to write a bit of custom javascript along the lines of this post: http://drupal.org/node/342183

Any further help would be great...

Comments

djalloway’s picture

I do not believe that Webform is the right module for this job.
You may want to look in the direction of CCK and it's Contributed modules.

quicksketch’s picture

I have to agree with djalloway, Webform is not really capable of what you're describing. Dynamic values such as this would cause quite a bit of trouble with Webform's analysis as nodes are added/removed. Webform requires this list to be rather static in order to display the results. Generally speaking, it sounds like Hierarchical Select module offers what you're looking for, but not within the Webform context.

beauz’s picture

Hirearchical Select is indeed similar functionality to what I need, however it doesn't look like I can easily tie it into the webform module.

I think it looks like I will have to write some custom AJAX functions and database queries to manually do it. Should be a nice challenge :/

I'd welcome anymore advice on how to achieve this if I do go down the CCK route, however the webform module does exactly what I need except this little piece. I don't really want to start storing each form submission as a new node...

djalloway’s picture

If using Webform is a must, maybe you should try writing your own component?
For example, take the "select.inc" component and re-write your own version where the select options are a dynamically pre-filled list of nodes?
That would be a start.

beauz’s picture

Thanks, yeah this will be my first custom component but that sounds like a great starting point. I'd like to keep everything modular and not start hacking the code, but I'm very much still learning in this aspect of drupal.

Thanks for the direction :)

adam_b’s picture

Subscribing... I have a situation where users choose from a list of select options, but if they select "other" then we'd like them to fill in a text field - a pretty common instance on forms.

beauz’s picture

To those wondering, I ended up going down the CCK path. Added a nodereference field and then used nodereference explorer to allow the user to apply exposed views filters and choose the node they need. It's still not the ideal solution i was initially looking for but it does the job.

quicksketch’s picture

Status: Active » Closed (fixed)

Closing this support request. Others may be looking for these feature requests:

#254728: Conditional fields
#330740: "Other" option in select lists for text entry