I have a cfform
with dynamically populated text fields. This is all inside of a logged in portal. If the database is empty when the user arrives at the form, I would like the fields to be "enabled" so they may fill out the information and submit the form. However, if they have already done so previously and the database is populated, I would like the fields to be "disabled".
Essentially, I'm wanting:
<cfscript>
if (isDefined("query.column"))
{
disable the cfinput fields
}
Is this possible? If not, any ideas on how to accomplish this?
Here is what I meant from my comment. I don't believe there is any reason to do what you want within
cfscript
tags. You are already using the tag syntax for your form so just check your condition(s) when you are building the form.For example, now you have something like this:
What I am suggesting is to do something like this:
Use similar conditions in the tags as you build the form for any other fields or buttons etc.