This project has moved and is read-only. For the latest updates, please go here.

Events example

    $(document).on("postSubmit.openform", function (event, data, moduleid, sf) {
        alert(JSON.stringify(data, null, "  "));
    });
    $(document).on("postRender.openform", function (event, control, moduleid, sf ) {
        var emailField = control.childrenByPropertyId["Email"];
        emailField.setValue("xxx@xxx.com");
        emailField.on("change", function () {
            alert(emailField.getValue());
        });

        emailField.options.validator = function (callback) {
            var value = this.getValue();
            //var age = this.getParent().childrenByPropertyId["age"].getValue();
            if (value.length > 20) {
                callback({
                    "status": false,
                    "message": "Too long!"
                });
                return;
            }
            callback({
                "status": true
            });
        }

       
    });

More in about callbacks
More in about observables

Last edited Aug 11, 2015 at 8:49 AM by sachatrauwaen, version 2