How do I make the first entry in a CFSELECT blank/empty?
I am using the CFSELECT statement below to populate a drop-down box. I need the first choice to be left blank. Other than creating a blank or NULL option in the database, it is possible? I need to make the first option blank and the drop-down required. Below is what I am using - thank you.
Thank you. So the value us what would get written to my master table? Would I then need to have additional code when viewing the record to say value 1 is widget A?
Ok, I basically have 1 master table where I am storing all details of my record. The drop down I started this thread about is a list of things that I am populating the drop down with. After a record is created, it can be viewed on a .cfm page and edited again.
This is the query I am using for the drop down:
In my CFC:
<cffunction name="GetSources"
returntype="query"
hint="Get Sources">
<cfquery datasource="#datasourcea#"
name="sources">
SELECT OrderID, Source
FROM Rtbl_Source
ORDER BY OrderID
</cfquery>
<cfreturn sources>
</cffunction>
On the page with drop-down:
<cfinvoke component="origdb"
method="GetSources"
returnvariable="sources">
Am I doing this in a way that is not preferred? I believe I am storing the "source" in my master DB as the real value and not the "ID" which I am calling OrderID so I could order them easier on my page.