Skip navigation
brianelliottlavoie
Currently Being Moderated

Empty Entry Prevention

Mar 23, 2010 12:53 PM

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).

 
Replies
  • Currently Being Moderated
    Mar 23, 2010 2:05 PM   in reply to brianelliottlavoie

    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.

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 24, 2010 5:29 AM   in reply to brianelliottlavoie

    What's the part you are having trouble with?

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 24, 2010 1:17 PM   in reply to brianelliottlavoie

    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.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points