dans.blog


The miscellaneous ramblings and thoughts of Dan G. Switzer, II

qForms v2.0 - Overriding the Default Dependency Mechanisms

When I was looking through my demo templates, I came across an example that showed some features in qForms v2.0 that I had forgotten I implemented, but it's something that's very cool and provides a lot of flexibility. What is this code you ask? Well, it deals with the createDepedencyTo() method.

For those of you who aren't familiar with this method, in a nutshell the createDependencyTo() method is used to build rule logic into your forms. For example, maybe you only want to require a user to enter their e-mail address if they've actually selected to have something e-mailed to them. You could do that like this:

oForm.email.createDependencyTo("EmailNewsletter", "yes");

more…