Hi Henry,

What you likely want to do is let the action page decide which SQL template to use, 
not the form page..  Here's a quick example (not debugged):

(form template):
<select name="action" size="1">
        <option value="add">Add Record
        <option value="update">Update Record
        <option value="delete">Delete Record
</select>

(action template)
<cfswitch expression="#form.action#">
        <cfcase value="add">
                <cfinclude template="add_widget_sql.cfm">
        </cfcase>
        <cfcase value="update">
                <cfinclude template="update_widget_sql.cfm">
        </cfcase>
        <cfcase value="delete">
                <cfinclude template="delete_widget_sql.cfm">
        </cfcase>
        <cfdefaultcase>
                Error - Invalid action passed
        </cfdefaultcase>
</cfswitch>

Quick n' dirty example, but it should give yuo an idea of the concept.

Take Care,

Seth

------------------------------
Seth Bienek
Solutions Development Manager
Stonebridge Technologies, Inc.
972.455.7294 tel
972.404.9754 fax
ICQ #7673959
------------------------------

> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
> Behalf Of [EMAIL PROTECTED]
> Sent: Monday, May 07, 2001 9:56 AM
> To: [EMAIL PROTECTED]
> Subject: Implementation of a 'select' element.
> 
> 
> I need to give a user an option to 'Add Record', 'Update Record', and
> Delete Record'.  Does anybody have working select element samples of this?
> The database is SQl Server7.0. All SQL statements are created and working
> fine. What  I want is to let a user select the action, press the 
> button and
> open a specific page where he/she can add a new record or modify an
> existing one. All pages already created. I just need a code to open a page
> corresponding to selected action.
> 
> Thanks in advance,
> 
> Henry
> 
> 
> -------------------------------------------------------------------------
> This email server is running an evaluation copy of the MailShield anti-
> spam software. Please contact your email administrator if you have any
> questions about this message. MailShield product info: www.mailshield.com
> 
> -----------------------------------------------
> To post, send email to [EMAIL PROTECTED]
> To subscribe / unsubscribe: http://www.dfwcfug.org
> 



-------------------------------------------------------------------------
This email server is running an evaluation copy of the MailShield anti-
spam software. Please contact your email administrator if you have any
questions about this message. MailShield product info: www.mailshield.com

-----------------------------------------------
To post, send email to [EMAIL PROTECTED]
To subscribe / unsubscribe: http://www.dfwcfug.org

Reply via email to