Skip to main content
Participating Frequently
January 10, 2011
Question

Best Simple Dynamic Form Content Practice

  • January 10, 2011
  • 1 reply
  • 1231 views

I have an idea for a form which has simple content subforms that I'm trying to put togther and I'm hoping I can do this in ColdFusion but I'm not that good at it yet to know what the best practices are to getting this done.

I have a form with a general question followed by choices with radio buttons.  I'm looking for added form content to be displayed when one or more radio buttons are selected.  For example:

What service are you looking for?

  ()  Hair

  ()  Nails

  ()  Shave

  ()  Wax

Then if somone selected "Hair", under Hair more form content would be displayed.  For example:

What service are you looking for?

  ()  Hair

          What are you doing

               ()  getting ready for a wedding

               ()  going on a date

               Do you need a

               ()  cut

               ()  trim

               ()  Style

                    ()  Mohawk

                    ()  Mullet

  ()  Nails

  ()  Shave

  ()  Wax

Sort of like that with the added content adding to the form.  I'm collecting the data in a simple MS Access DB and working with CS4.  My server runs the latest version of CF.

Sounds simple enough but I'm not sure how to go about it and/or what the best practices are.  Any guideance?

Thank you for any help in advance!!!

-- Dax

    This topic has been closed for replies.

    1 reply

    Inspiring
    January 10, 2011

    Hi,

    Good that you gonna use Radio button which enable you to select only one option.

    Use Bind option in CFINPUT;

    On your cfc function, pass the Hair(id or name- how its there in your Database), in the function query it and return the query result using CFRETURN.

    Participating Frequently
    January 10, 2011

    Hmmm.  Actually, maybe using radio buttons is not such a good idea since I want subforms to populate for each selection and there can be more than one, even all, selected so maybe checkboxes.  But here's the catch.  What you're suggesting is that the user hit the submit button to return the sub form and that's not what I'm looking for.  I'm actually looking for the functionality that the form itself expands with a selection automatically.  In other words, user checks box, then the form expands with additional questions for their selection.  Then when the entire form is filled out as best it can, the user submits the data.  THAT's more like what I'm looking for.

    Inspiring
    January 10, 2011

    Using this BIND will not submit your form.

    The functionality which you specified can be done in CSS; Provided you should fetch allthe details, and only when the Hair link is link, it will get expanded.