> The form in the page is submitting to the same page. If
> the user refreshes the page, then, the query to insert the
> record filled out in the form is executed again. So, the
> number of records in the table keep increasing.

> is there a way to prevent this?

> The primary key in the table the data is being inserted is
> a counter that increments itself. It is not part of the
> query that is inserting the new records.

> merci!

salut!

Typically this is worked around by using <cflocation> after the form
is submitted to return the user to a page with no database
inserts/updates. Whether this is the same page or another page is
irrespective. Different developers have different philosophies -- I
tend to return the user to an index page where they can see a list of
records in the updated table. There's also a javascript alternative if
you don't like <cflocation> which is

<script language="JavaScript">
  location.replace("new/url/here.cfm");
</script>

instead of

<cflocation url="new/url/here.cfm" addtoken="false">

For browsers supporting javascript this behaves the same as
<cflocation> by replacing the current page in the browser's history
stack so that if they use their back button, they will bypass the page
containing the database update and the location.replace() method call.
(This eliminates the common complaint about javascript relocation
causing problems with the user's back-button.)

s. isaac dealey   954.927.5117
new epoch : isn't it time for a change?

add features without fixtures with
the onTap open source framework

http://macromedia.breezecentral.com/p49777853/
http://www.sys-con.com/story/?storyid=44477&DE=1
http://www.sys-con.com/story/?storyid=45569&DE=1
http://www.fusiontap.com




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:193913
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to