Cfform not validating borderline personality disorder and online dating
There is no "built-in" way to specify such a thing. As always, use these tips only if you know what you are doing ;), as they may have side effects.The key is to call the following when we want to disable the validation on a given field.Let’s start with our original form converted to Cold Fusion tags, as shown in Listing 16.6.cfform1You can use the REQUIRED attribute to ensure that the required fields are filled in prior to form submission. In this case, you will use REQUIRED= H YES in both the Name and Phone fields, as shown in Listing 16.7.Nothing that you have seen so far in this chapter requires the use of Cold Fusion-spedfic capabilities.
If you extend your specification to require a full U.
Of course, that means you shouldn't rely solely on the Java Script validation since data coming from a browser that doesn't support it won't be validated. A cool thing is that you can generally use these same Java Script regular expression patterns in the CFML code that processes the form, using them in the REFind or RE-Find No Case functions. One last thing to note about our use of CFFORM in the preceding example: I used an empty string for the form's ACTION attribute value. It can't be left off, and even though in this particular example it doesn't really matter where we submit to, we have to provide one.
Since we're only interested in observing the behavior when we try to submit it, I left the action blank so the page will just call itself.
Built-in validation in cfform is great, but sometimes, it is a little inflexible.
What happens if we want to require a State field only if the Country field is US?