If you are new to Coldfusion you may find this site useful.
http://www.katungroup.com/coldfusionlinks2.htm

Bill Guttman
http://www.katungroup.com



-----Original Message-----
From: Amy Steel [mailto:[EMAIL PROTECTED]]
Sent: Monday, May 15, 2000 10:06 AM
To: >
Subject: Form Wizards and too many buttons


Hello, everyone.  I'm pretty new to the ColdFusion world, so please forgive
me if I ask something that seems a little obvious.  I'm still learning the
ropes.

In the Feb 2000 issue of ColdFusion Journal, there's some code that creates
some killer form wizards.  One problem, though.  The WizForm.cfm custom tag
that collects info from "screen" to "screen" also includes the buttons
(back, submit, next).  This is fine for a straight wizard, but I want to
pass the info in a CFMail tag to an e-mail that is stored in one of the form
variables.  I can get everything to work, but when I send the info to the
processing page where the CFMail tag is, it sends the mail and shows the
user a confirmation page - - - with a back, submit, and next button on it!
It's making me crazy.  How do I get these buttons off of here.

<!- - - Here is the WizForm.cfm custom tag - - ->

<CFSET ButtonWidth = 90>
<CFIF ThisTag.ExecutionMode is 'start'>
        <CFSET Caller.Fields = StructNew()>

<!--- deserialize wddx into Field struct --->

<CFWDDX Action=WDDX2CFML Input="#FORM.WizFields#" Output="Caller.Fields">

<!--- Update Fields struct for all fields submitted via FORM --->

        <CFSCRIPT>
                        for (thisKey in Caller.Fields)


                        if(isDefined("FORM." & thisKey))
                        Caller.Fields[thisKey] = evaluate("FORM." & thisKey);
        }
        </CFSCRIPT>

<!--- serialize Fields structure back into wddx packet and then hide in
hidden field --->

        <CFWDDX Action="CFML2WDDX" Input="#Caller.Fields#" Output="FieldWDDX">

                <CFOUTPUT>
        <FORM Name="WizForm" Method="Post">
        <INPUT Type="hidden" Name="WizFields"
Value="#HTMLEditFormat(FieldWDDX)#">
        <INPUT Type="hidden" Name="WizScreens" Value="#FORM.WizScreens#">
        <INPUT Type="hidden" Name="WizCurrentScreen" Value="0">
        </CFOUTPUT>

<CFELSE>

<!--- This is </CF_WIZFORM> --->
<!--- Add appropriate navigation buttons --->
<!--- This is the Back button --->

        <CFOUTPUT>
        <TABLE border=0 cellspacing=2 cellpadding=3>
        <TR><TD width=#ButtonWidth# valign=middle align=center>&nbsp;
        </CFOUTPUT>

        <CFIF FORM.WizCurrentScreen GT 2>

                <CFOUTPUT>
                <INPUT Type="Submit" Name="WizBack" Value=" < Back  " AccessKey="B"
                        onClick="document.WizForm.action='#ListGetAt(FORM.WizScreens,
FORM.WizCurrentScreen - 1)#';
                        document.WizForm.WizCurrentScreen.value =
#evaluate('FORM.WizCurrentScreen - 1')#">
                </CFOUTPUT>

        </CFIF>

<!--- This is the Submit Request button --->

        <CFOUTPUT>
                </TD><TD width=#ButtonWidth# valign=middle align=center>&nbsp;
        </CFOUTPUT>

        <CFIF FORM.WizCurrentScreen IS (ListLen(FORM.WizScreens) - 1)>

                <CFOUTPUT>
                <INPUT Type="Submit" Name="WizFinish" Value="Submit Request" 
AccessKey="S"
                        onClick="document.WizForm.action='#ListLast(FORM.WizScreens)#';
                        document.WizForm.WizCurrentScreen.value =
#evaluate('FORM.WizCurrentScreen')#">
                </CFOUTPUT>
        <CFELSE>

<!--- This is the Next button --->

                <CFOUTPUT>
                <INPUT Type="Submit" Name="WizNext" Value="  Next > " AccessKey="N"
                        onClick="document.WizForm.action='#ListGetAt(FORM.WizScreens,
FORM.WizCurrentScreen + 1)#';
                        document.WizForm.WizCurrentScreen.value =
#evaluate('FORM.WizCurrentScreen + 1')#">
                </CFOUTPUT>
        </CFIF>

<!--- This is the Cancel button --->

                <CFOUTPUT>&nbsp;</TD>
                <TD width=#ButtonWidth# valign=middle align=center>&nbsp;
                <INPUT Type="Submit" Name="WizCancel" Value=" Cancel "  AccessKey="C"
                onClick="document.WizForm.action='#ListFirst(FORM.WizScreens)#';
                document.WizForm.WizCurrentScreen.value = 2">
                </TD>
                </TR>
                </TABLE>
                </CFOUTPUT>
        <CFSET na = StructClear(Caller.Fields)>

</CFIF>

<!- - - Here is my processing page - - ->

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<HTML>
<HEAD>
<TITLE>Information Technology Service Request Form</TITLE>
</HEAD>

<BODY>
<CF_WIZFORM>
<CFMAIL FROM="#Fields.ReqEmail#" SUBJECT="Service Request"
TO="#Fields.MgrEmail#">
Dear #Fields.MgrName#,

Please review the following Service Request from #Fields.FirstName#
#Fields.LastName#.

Request Date: #Fields.ReqDate#
First Name: #Fields.FirstName#
Last Name: #Fields.LastName#
Title: #Fields.Title#
Requester's Extension: #Fields.ReqExt#
Requester's E-Mail Address: #Fields.ReqEmail#

Requester's Building: #Fields.ReqBldg#
Requester's Department: #Fields.ReqDept#
Requester's Desk Stop: #Fields.ReqDesk#

Manager's Name: #Fields.MgrName#
Manager's Extension: #Fields.MgrExt#
Manager's E-Mail Address: #Fields.MgrEmail#
Department Cost Center: #Fields.ReqCostCtr#

Request Description: #Fields.ReqDesc#

Cost Benefit: #Fields.CostBenefit#

Requirements: #Fields.Requirements#

If you wish to approve this request, please forward this e-mail to
[EMAIL PROTECTED]  If you wish to deny this request, you need only to
delete this e-mail and then, follow up with #Fields.FirstName#.

Thank you!
System Services Department
</CFMAIL>
</CF_WIZFORM>


<H1>Your Service Request has been submitted.</H1>
<H3>Thank you for your request.  It has been forwarded to your appropriate
management.</h3>

<h4><a href="http://172.20.4.70/ssd/NewPages/Home.htm">Click here to return
to the System Services Home Page</a></H4>

</BODY>
</HTML>

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

So, that's my story and I'm stickin' to it.

For the bio stuff... here goes...

Amy Steel
Web Developer
Yazaki North America, Inc.
Canton, MI  USA  48187
[EMAIL PROTECTED]

Coming from a Web Design position in a Help Desk oriented IT division, I've
been working mostly with FrontPage 2000 on a Netscape Enterprise 3.6 Server.
I have more server/systems background than scripting/coding background so I
feel like I'm doing this stuff a little haphazardly at times, but it's
pretty cool and I'm getting into it.

What else is there?  Oh yeah!

Dr. Pepper, Doritos, and Chocolate.  That should cover the rest of the
"developer" stuff.  ;-)

Take care, all, and let me know if you can help me out!

Much appreciated,
Amy
----------------------------------------------------------------------------
--
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=sts&body=sts/cf_talk or send
a message to [EMAIL PROTECTED] with 'unsubscribe' in the
body.

------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to