5 Replies Latest reply on Jul 6, 2007 2:16 AM by bryn50

    Dynamic Forms (Data Dictionary) using CFForm (??)

    bryn50 Level 1
      Hi,

      The basic plan is to build the forms in my application dynamically using a data dictionary rather than basing them upon static tables and having statically coded forms to match. This would allow me to offer the ability for an administrator to add new fields if required (client 'requirements' are hard to pin down and may therefore change).

      I'm developing using CF8 (hoping it will be released real soon..;-).). Application will be structured using Fusebox 5.

      I've tried building up the form elements (<cfinput> & etc) off in CFC, returning the layout result code in a content variable, and its not working.
      I have some other approaches to try, but this one would be preferable.

      Has anyone else tried this - and do you have any advice to offer (or am I just crazy trying it because there is no way its going to work ?)

      Thanks
      Bryn50
        • 1. Re: Dynamic Forms (Data Dictionary) using CFForm (??)
          efecto747
          I've noticed a few discussions about this problem, most recently in This Thread

          Do you have to use the <cfform> tag or could you get away with just using <form> instead? That would certainly solve your problem.

          Personally I never use cfform, I prefer to write my own validation code to give me better control and also cut down on code that cfform adds that I don't necessarily need.

          cheers
          • 2. Dynamic Forms (Data Dictionary) using CFForm (??)
            bryn50 Level 1
            This approach works well using standard html forms and html form controls such as <input> and <select> etc.

            I'm wanting to use CFFORM (for the first time in a long time) for the functionality on offer (such as flash forms).
            As I saw elsewhere, I have not used this in a verrry long time because generally I've found it inflexible and the validation on offer is a tiny subset of what is generally needed. I'm kinda hoping to be able to overcome that this time around by adding my own javascript validation when necessary.

            I have some ideas for approaches that might work, but they don't seem like very good ones to me:
            1/. might be to try using standard html form controls inside a cfform. Can I still have it display using flash ?
            2/. might be to have all of the logic that selects the appropriate cfform control for a given field in the same file as the cfform, however that seems so unelegant and also it defies the MVC/fusebox 5 approach I'm also wanting to use.

            Thanks for your help...
            Cheers,
            ...

            • 3. Re: Dynamic Forms (Data Dictionary) using CFForm (??)
              efecto747 Level 1
              Fair enough, I guess there are some benefits in using cfform, although I'm not a huge fan of flash forms..

              I noticed in another discussion on this topic HERE that BKBK suggested using a custom tag to achieve this functionality.

              I haven't tried this myself but it might be worth a look.

              cheers
              • 4. Re: Dynamic Forms (Data Dictionary) using CFForm (??)
                Dan Bracuk Level 5
                Regarding, "Has anyone else tried this - and do you have any advice to offer (or am I just crazy trying it because there is no way its going to work ?)"

                I have never tried it. You are not crazy, you are ambitious.

                Regarding, "1/. might be to try using standard html form controls inside a cfform. Can I still have it display using flash ?"
                no

                Regarding the general nature of your questions, I don't understand them.

                • 5. Re: Dynamic Forms (Data Dictionary) using CFForm (??)
                  bryn50 Level 1
                  Thanks for that.

                  BKBK had the answer all right, this does work when using a good old custom tag. Not the most elegant solution, but it will work, and avoid having a bunch of ugly control logic in my display form.

                  Cheers,