API/Form

From aMember Pro Documentation
Revision as of 08:14, 28 June 2011 by Alex (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

aMember Pro utilizes [HTML_QuickForm2] library to handle forms displaying and validation. Please check usage example of HTML_QF2 to get understanding how it works:

[QF2 Tutorial] [DataSources] [Rules and Validation]

aMember Pro defines a class Am_Form derived from HTML_QuickForm2 and adds the following:

  • function isSubmitted() // @return bool
  • function setAction($action) // to set "action" form attribute
  • function removeElementByName($name) // to remove element from form by its name
  • adds jquery.validate support for basic HTML_QF2 rules

New elements and rules

  • 'callback2' validation rule: it runs a callback and validation fails if function returned string value, validation succeed if null returned
  • 'advradio' element - configured like the 'select', but displayed as group of radiobuttons
  • 'upload' element - handles uploads with history and ability to select from already uploaded files for this tag
  • 'date' element - to provide JQuery UI datepicker support