If you add a "name" attribute to your submit button:
<input type="submit" name="submit" value="Enter New Donor">
then when the form is submitted, there will be a corresponding "submit"
key added to the form scope. Then, as others have suggested, wrap your
query in:
<cfif StructKeyExists(form, "submit")>
//Your query here
</cfif>
Again, as the others have stated, this will cause the query to only be
executed if the form is actually submitted, rather than on every page load.
HTH,
-Carl V
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive:
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:353940
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm