• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

21. Creating Custom Tags > 21.5. Attribute Validation and Error Handling

Attribute Validation and Error Handling

In the previous section, we touched briefly on the idea of attribute validation when we used the cfparam tag to validate and set default values for a custom tag’s attributes. This section takes things a step further by demonstrating various techniques you can use to create both required and optional attributes for your tags. Additionally, we’ll look at error- and exception-handling strategies you can use to deal with problems that occur in your custom tags.

Handling Required Attributes

Depending on the type of custom tag you create, you may want or need to require certain attributes to be passed in order for the tag to do its job. Making a tag attribute required is as simple as using a


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint