Copy link to clipboard
Copied
Essentially, here is what I want to happen:
Instead of making it a requirement to enter data into a textbox (cfinput), I want to make it so if there is an empty textbox, the entire form will not be entered into the database, but will act as though it were submitted (I know this sounds strange, but this is actually what needs to happen).
Copy link to clipboard
Copied
Submit the form, then on the action page validate the values according the the business rules and chooe the appropiate branch for what happens to the data from two or more appropiate choices.
Copy link to clipboard
Copied
What's the part you are having trouble with?
Copy link to clipboard
Copied
Thank you both for your quick repsonses, however I have solved the problem. What I did was put CFIF statements around each query stating that if the textbox was empty, it wouldn't run the query script.
Copy link to clipboard
Copied
Ok, good. That was pretty much what we where guiding you towards.
But separate if statements around each <cfquery...> block? Are they all testing the same form field? If so, wouldn't it be easier to have one at the beginning of the file that tests the field and then prevents the processing of any of the database code? That's what I would have tried for. I like writing less code whenever possible.