Fork me on GitHub

Clip & Form validation  Bottom

  • Dear all,
    due to project requirements I will need to add specific fields validation, is there an easy way to add custom validation?
    In exemple: if a category is choosen then this field is not empty.
    Thanks in advance,
    Philippe
  • pnForm has all sorts of validation routines if you use the right subclass. As long as it is a simple form that should work very well. For complex forms you are going to need to roll your own.
  • Yes, could you be a bit more precise. Do you think I would need to override the "handleCommand" method of the user form handler? If yes, where can I copy it in the config directory?
    Thanks
  • Sure I can. pnForm is built using OOP (Object Oriented Programming). Therefore you just create a subclass of the class you are trying to use and override the handleCommand function. There is a tutorial in the docs that goes through a bunch of this. Here is a URL to an example http://community.zik…leProgrammingPart10. You may find other pages about module programming useful. Here is a link to the developer docs.
    http://community.zik…g-DeveloperDocs.htm
    If you get stuck, just post here. People are always happy to help

This list is based on users active over the last 60 minutes.