Re: form-post to SQL-insert creates double-entry

2013-01-16 Thread Carl Von Stetten
If you add a "name" attribute to your submit button: 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: //Your query here Again, as the others have stated, this will cause the query

Re: form-post to SQL-insert creates double-entry

2013-01-15 Thread Dan Baughman
during your logic to action something on the page validate it in some slight way. EG. TAKE SOME ACTION On Tue, Jan 15, 2013 at 1:44 PM, Matt Quackenbush wrote: > > You are running the insert query each time you load the page. Remove your > s on the form fields, and wrap the query in an

Re: form-post to SQL-insert creates double-entry

2013-01-15 Thread Dan Baughman
the better approach is to go ahead and keep the cfparam, and then during your logic to action something on the page validate it in some slight way. EG. TAKE SOME ACTION On Tue, Jan 15, 2013 at 1:44 PM, Matt Quackenbush wrote: > > You are running the insert query each time you load th

Re: form-post to SQL-insert creates double-entry

2013-01-15 Thread B Griffith
Fellas, Thank you very much! It worked like a charm. And I'm taking your suggestion re: data scrubbing/validation, I have a CF8 book that will hopefully shed a little light on that subject. I only just noticed there is a "ColdFusion Newbie" forum here and that is probably where my posts/iss

RE: form-post to SQL-insert creates double-entry

2013-01-15 Thread Leigh
> The FORM structure itself always exists. So the check needs to be on one of the individual fields, or you could check whether it is non-empty like Matt suggested. As an aside, once you get this solved you should read up cfqueryparam too. Among other things it helps protect against sql inje

Re: form-post to SQL-insert creates double-entry

2013-01-15 Thread Matt Quackenbush
You are running the insert query each time you load the page. Remove your s on the form fields, and wrap the query in an . HTH On Tue, Jan 15, 2013 at 2:34 PM, B Griffith wrote: > > Hello All, > > I appreciate everyone's help on my other posts and think I'm coming to > understand CF

RE: form-post to SQL-insert creates double-entry

2013-01-15 Thread Dave Jemison
Oops- forgot that you had CFPARAMs for all the variables. You'd need to remove those with the conditional. -Original Message- From: Dave Jemison [mailto:djemi...@vinesse.com] Sent: Tuesday, January 15, 2013 12:46 PM To: 'cf-talk@houseoffusion.com' Subject: RE: form-pos

RE: form-post to SQL-insert creates double-entry

2013-01-15 Thread Dave Jemison
Do you mean that all the code on one page (input.cfm)? If so, this about it logically. The addDonor query is processed every time the page is loaded- once where the user enters the data (blank data except for the PK) and a second time (with the user entered data). You need a conditional around t

Re: form-post to SQL-insert creates double-entry

2013-01-15 Thread John M Bliss
Try something like this: INSERT INTO DONOR (first,last,flag,supe,phone) VALUES ('#form.first#','#form.last#','#form.flag#','#form.supe#','#form.phone#') On Tue, Jan 15, 2013 at 2:34 PM, B Griffith wrote: > > Hello All, > > I appreciate everyone's help on my other posts and think I'm co