dans.blog


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

New Method Idea for qForms--Conditional Processing...

Last night I was thinking about the changes I had made to the createDependencyTo() method and started thinking that there might be times when you'd want to do something similiar, but instead of having one field affect another in some manor you'd define a rule for a field if it meets a given condition.

My basic thought would be to add a new method you could call. I've been tossing around the idea of setActionRule(), setConditionAction() or setConditionalRule(). Something along those lines. The idea would be that if the value of the field this method was attached to equal a condition supplied, a function would be triggered.

oForm.format.setActionRule(
    function (sValue){
        alert("You have selected to recieve the newsletter in " + sValue + " format.");
    }
);

more…