This content has been marked as final. Show 8 replies
For the view, then send part, think about what you can do with cfsavecontent in the session scope.
For the selection of tables and fields, you are asking for trouble if you want the users to type these. Maybe related selects are a better option.
Good though about it being a bad idea having the type that in. I think there is a table that has all the ID's that would be valid for that box, so I can probably just turn that into a drop down.
I hate to sound like a leech here, but could you maybe provide a bit of sample code for what you are thinking about with the sessions and the savecontent? I just don't follow your train of thought. Thanks for your help so far, I really appreciate it.
cold fusion and html code goes here
Also bear in mind that cfmail is in some ways equivalent to cfoutput.
Thanks for the tip, Ill try and write something real quick and see how it goes. I'll let ya know how it turns out.
Well I tried. Sadly I'm just having a hard time wrapping my brain around this. I know its not hard, but I'm just not comprehending.
Here is a link to the demo app
And attached is my code. I tried with and without CFOUTPUT around the SAVECONTENT but it didn't work either way. I just wrote a super simple demo app. Basically you should be able to enter #Firstname# in there, and it will then evaluate that when it outputs it to the screen, but it does not.
As a side note, if the info didn't have to come from a form box, your original idea works beutifully. You can type text and variables in there, and it does exactly what you would expect it to do. However, when you feed the form variable into there, it does not parse the variables, inside of the variable. It gets passed #form.Myletter# and it just slaps that in there, it doesn't look inside #form.Myletter# to see if there is anything in there that needs evaluation. I really have no idea how to get around that.
Awesome, I figured it out!
Sorry for the triple post, but I wanted to post my solution in case anyone else can benefit from it. If you are trying to allow a person to write a letter or something and let them use variables, something like the following works pretty well. This is a super simple demo app to show off what Im talking about. I hate that I have to use evaluate, but i don't think i had a choice here.
You do not have to use evaluate. Use array notation:
That said, you might consider obfuscating the column names, rather than exposing your database schema.
Hey sweet tip about getting around using evaluate. I didn't think I could use array notation like that. I would do something about hiding the database scheme, however I would then need to create some kind of like metadata table that has alternate names for the column names, and that would be kinda a pain. This is an internal only use tool (only for about 3 people here in the office) and it will be secured. I'm not even sure most people would know that those field names correlate to database column names. I suppose more astute users might be able to figure that out. I'll think about it, but sounds like more worth than it's worth :P