The only problem with that is the fact you have to run a query to get the
recodcount. Causes a little more overhead than what would be needed to access
a session var.




Douglas Brown
Email: [EMAIL PROTECTED]
----- Original Message -----
From: "Tony Carcieri" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Monday, September 09, 2002 1:49 PM
Subject: RE: Preventing User from Re-submitting "Add Record" Form


> couldn't you use recordcount?
>
> <cfif #somevalue.recordcount GT 1>
> <!---go back a page or some other piece of code--->
> <cfelse>
> <!---do something else--->
> </cfif>
>
> i know in ASP this is done (I am doing that right now for a client).
>
> HTH,
> T
>
> -----Original Message-----
> From: Everett, Al [mailto:[EMAIL PROTECTED]]
> Sent: Monday, September 09, 2002 4:46 PM
> To: CF-Talk
> Subject: RE: Preventing User from Re-submitting "Add Record" Form
>
>
> There's a couple of ways to handle that.
>
> One is to set a session variable or cookie at the time they reach the
> confirmation page. The idea being that your form template would check for
> the existence of that session variable or cookie and, if found, stop them
> from submitting the form.
>
> Another way would be to put a timestamp on all your database records. Then,
> before inserting, check to see if an identical record was submitted within,
> say, the last half hour. This is more labor-intensive, but removes any
> issues with blocked cookies, proxy servers, browser caching, et. al.
> Obviously, if an identical record is allowed you'll need to account for
> that. To expand on this, you may present the user with a message that the
> record appears to already have been submitted and ask if they're sure they
> want to submit it again.
>
> There are other ways to handle it as well. (Stay tuned for the
> history.forward() trick.)
>
> > -----Original Message-----
> > From: Bob Haroche [mailto:[EMAIL PROTECTED]]
> > Sent: Monday, September 09, 2002 4:32 PM
> > To: CF-Talk
> > Subject: Preventing User from Re-submitting "Add Record" Form
> >
> >
> > I've a simple membership app which allows a user to add a new member
> > record. Once the record is added, the user is sent to a page
> > displaying the results of the data provided. If the user has inputted
> > incorrect data, this confirmation page has a link to update the newly
> > added record. That's all fine.
> >
> > But here's the problem: if the user instead uses the browser back
> > button, they're returned to the "Add New Record" page where they can
> > change the information previously provided. Once they re-submit that
> > form, of course, the original record is not updated but instead a
> > second, new record is created.
> >
> > How do I best prevent the user from re-submitting the "Add New Member"
> > form when what they really need to do is use the "Edit Member record"
> > form.
> >
> > A google search reveals the existence of a "Submit Once" CF custom
> > tag, which might help(?), but it's no longer available on the MM site.
> >
> > TIA.
> >
> > Regards,
> > Bob Haroche
> > O n P o i n t  S o l u t i o n s
> > www.OnPointSolutions.com
> >
> >
>
> 
______________________________________________________________________
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
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