Hey guys!
I am new to Drupal, and I have a question. I made a custom form using CCK for a client, and this client wants certain parts to appear and disappear based on what the user has chosen in a combo box. These items that would appear and disappear can be of any type (combo box, text field, etc., etc.). There would be a couple of these special combo boxes. Also, depending on what the user has chosen, these new appearing fields would be required. I don't want them to be required when the user has chosen something else to make them not appear, as that wouldn't make any sense! (why would you require a field to be filled in when you can't even see it, and it's not required for what you want to do?) Will I have to use JavaScript or something to do this? I want to try and make it as easy as possible for my client to build custom forms like this in the future.
Thanks again!
Comments
Without some work that would be hard to make client friendly
What you ask would be possiible with some custom coding code (ie a module).
By using CCK groups you could group the dependent fields and with some javascript you go determine which group is displayed based on a user select. The required part would be straightforward with extra validation code though visually displaying something as "optionally required" would be an interesting challange.
One thing to note the webform module make custom forms CCK custom content types. There are some differences here and generally I would not recommend having clients generate their own content types (CCK) unless they understand all the details that go with that. Now generalizing the abiliity to specify such a relation so an end client could do that would take a bit of effort.
Thanks for the response...
Thanks for the response! Do you think Drupal is the best CMS for what I need to do in terms of these custom forms and the other options that are available? If you have any other suggestions about what I can do to make these forms more friendly for people that need to fill them in, let me know. Another thing I was thinking about was that I could split the form up into multiple pages.
Secondly, how would I go about customizing the layout of these forms? Everything's in one column right now, and it looks really bad. Would I use something like Views or Content Templates for CCK?
Thanks again!