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

Staying in Good Form

Naming conventions are extremely helpful in avoiding common form-processing errors. The trick is to create unique labels for form elements that are instantly identifiable to the developer. My technique is to combine the type of form element with its purpose. For example, I would call a text field for accepting the name of a country countryText—whereas a list element for the same purpose would be countryList. I use mixed case (also known as intercapping) to avoid spaces—a definite no-no in web naming—but this helps keep it legible. Doesn’t feel right? Try my partner’s method of putting the type of field first, like txtCountry or lstCountry. Doesn’t matter which road you take—the main thing is to pick a direction and stick with it. Both ways will hasten your coding journeys.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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