>>Has anyone stored the variable name, and the form type in a database - and built the form dynamically on the fly?
Well, I'm presently working on something that does this, although its rather the contrary ;-)
In fact, I'm using CFX_ODBCInfo to get the DB tables, field names, types and sizes to build a form to enter the values.
Just as an example, I can generate the form below with exactly 21 clicks, the first one being to select the datasource, then cut'n paste it into CF Studio. I just have to finish it with the styling, etc.
It generates automatically the queries needed for the select areas, and the caption from the field can be drawn from the column names or even from the column description.
<CFQUERY NAME="get_Beans" DATASOURCE="Coffee Valley">
SELECT Bean_ID, Name
FROM Beans
</CFQUERY>
<CFQUERY NAME="get_Clients" DATASOURCE="Coffee Valley">
SELECT Client_ID, ClientName
FROM Clients
</CFQUERY>
<CFQUERY NAME="get_Orders" DATASOURCE="Coffee Valley">
SELECT * FROM Orders
</CFQUERY>
<CFOUTPUT>
<FORM NAME="" ACTION="" METHOD="post">
<TABLE>
<!--- Client_ID --->
<TR>
<TD>Client ID:</TD>
<TD><SELECT NAME="Client_ID" SIZE="1">
<CFLOOP QUERY="get_Clients">
<OPTION VALUE="#get_Clients.Client_ID#"<CFIF get_Orders.Client_ID EQ Client_ID> SELECTED</CFIF>>#get_Clients.ClientName#</OPTION>
</CFLOOP>
</SELECT></TD></TR>
<!--- Bean_ID --->
<TR>
<TD>Bean ID:</TD>
<TD><SELECT NAME="Bean_ID" SIZE="1">
<CFLOOP QUERY="get_Beans">
<OPTION VALUE="#get_Beans.Bean_ID#"<CFIF get_Orders.Bean_ID EQ Bean_ID> SELECTED</CFIF>>#get_Beans.Name#</OPTION>
</CFLOOP>
</SELECT></TD></TR>
<!--- AmountOrdered --->
<TR>
<TD>Amount Ordered:</TD>
<TD><INPUT TYPE="TEXT" NAME="AmountOrdered" SIZE="50" MAXLENGTH="50" VALUE="#get_Orders.AmountOrdered#"></TD></TR>
<!--- DateOrdered --->
<TR>
<TD>Date Ordered:</TD>
<TD><INPUT TYPE="TEXT" NAME="DateOrdered" SIZE="19" MAXLENGTH="19" VALUE="#get_Orders.DateOrdered#"></TD></TR>
<!--- DeliveredTime --->
<TR>
<TD>Delivered Time:</TD>
<TD><INPUT TYPE="TEXT" NAME="DeliveredTime" SIZE="19" MAXLENGTH="19" VALUE="#get_Orders.DeliveredTime#"></TD></TR>
</TABLE>
</FORM>
</CFOUTPUT>
--
_______________________________________
REUSE CODE! Use custom tags;
See http://www.contentbox.com/claude/customtags/tagstore.cfm
(Please send any spam to this address: [EMAIL PROTECTED])
Thanks.
[Todays Threads]
[This Message]
[Subscription]
[Fast Unsubscribe]
[User Settings]
[Donations and Support]
- Help! - Dynamically Generate Forms from SQL DB - Bad Ide... millerj
- Re: Help! - Dynamically Generate Forms from SQL DB ... Adam Haskell
- Re: Help! - Dynamically Generate Forms from SQL DB ... Aaron DC
- Re: Help! - Dynamically Generate Forms from SQL DB ... Claude Schneegans
- Re: Help! - Dynamically Generate Forms from SQL... Claude Schneegans
- Re: Help! - Dynamically Generate Forms from SQL DB ... Matt Robertson
- RE: Help! - Dynamically Generate Forms from SQL DB ... Matthew Walker
- RE: Help! - Dynamically Generate Forms from SQL DB ... Matthew Walker
- RE: Help! - Dynamically Generate Forms from SQL DB ... Micha Schopman
- RE: Help! - Dynamically Generate Forms from SQL DB ... Micha Schopman
- Small query question.. techmike
- Re: Small query question.. Jason Lemahieu