The form action page is a sure-fire way of getting those form variables to
the preview page.  The only other way I can think of is by doing some client
side JS code to transfer the form values to the preview page.  I'd advise
against that, as I prefer to keep that kind of application code server side
(especially since you have regular expression code to consider as well). 

Consider this.  You could have a preview page with the options "Commit"
(which does teh db insert) or "Go Back" (which goes back to the populated
form).  

Another idea.  When I do thing like this, I like to combine the editor and
the actual display as much as possible.  For an editor that allows
add/edit/delete on a page of links, I would have one page with the editor on
top and the display (as the users see it) on the bottom.  Doing it this way,
I can place the display section on as an include (the include will have the
intelligence to determine if it's in "display public" or "display admin"
mode.  This way, I only have to write the display code once and don't have
to worry about syncing changes to multiple versions of the same file.

Admittingly, a links page is a pretty simple animal.  Not all templates are
going to accomodate this design.  if you can find a way to make an editor
that displays the data as seen in the public section, sometimes you can
avoid having preview pages.

Good luck!

EC
        


-----Original Message-----
From: Ian Vaughan [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 18, 2002 9:28 AM
To: CF-Talk
Subject: Re: Advanced Coldfusion - Generating Preview Pages ???


Eric

 does it have to be in the form action page ???

Could it not be a seperate template and when they click on the preview pa
ge
button it opens a new broswer window with the preview template with the d
ata
conatined in the form variables displayed as if it was viewed through CF 
in
a web browser as an end user/


Also in my processing (action page) there are some regular expressions su
ch
as

<cfset storydate = form.event_month & "/" & form.event_day & "/" &
form.event_year>
<cfset storydate = #CreateODBCDate(storydate)#>
<cfset formatted_date = dateformat(storydate, "MM/DD/YYYY")>
<cfset content = REReplacenocase(content, "</*font[^<>]*>", "", "ALL")>
<cfset content = REReplacenocase(content, "</*span[^<>]*>", "", "ALL")>

So how would my preview page actually look like to display the form
variables ?

Ian



----- Original Message -----
From: "Carlisle, Eric" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Friday, January 18, 2002 1:59 PM
Subject: RE: Advanced Coldfusion - Generating Preview Pages ???


> Sure...
> In the template that processes the form entries-->
>
> <cfif isDefined("FORM.submit")>
> <cfif FORM.submit eq "Preview">
>
> ** code to preview **
> (you could include the template that outputs to end users - just
> modify it to also handle FORM variables when applicable).
>
> <cfelseif FORM.submit eq "Add">
>
> ** code to insert record to database **
>
> </cfif>
>
> </cfif>
>
>
>
>
> -----Original Message-----
> From: Ian Vaughan [mailto:[EMAIL PROTECTED]]
> Sent: Friday, January 18, 2002 8:48 AM
> To: CF-Talk
> Subject: Advanced Coldfusion - Generating Preview Pages ???
>
>
> I am using standard html forms in a browser to allow admin users to
> add/modify entries to an oracle database via Coldfusion.
>
> When the form is submitted these changes are then sent to the relevant
> fields in the database table.
>
> And a seperate coldfusion template displays the output to end web
> users.
>
> At present this is all done automatically when the user submits the
> form.
>
> What I would like to do, is offer the administration user (who
> adds/modifies
> stories) a preview option of how the page would look in the web
> browser,
> before they actually submit their details to the database, so they have
> an
> idea of how the information they have just entered in the relevant form
> fields would look when generated from coldfusion and viewed by an end
> user
> in their browser.
>
>
> Is this process viable with Coldfusion , if so have any list members
> achieved anything like this?
>
> Ian
>
>
> 

______________________________________________________________________
Dedicated Windows 2000 Server
  PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER
  Instant Activation � $99/Month � Free Setup
  http://www.pennyhost.com/redirect.cfm?adcode=coldfusiona
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to