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 ?)
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.
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.
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.
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.