How to use the @hpcc-js/form.Form function in @hpcc-js/form

To help you get started, we’ve selected a few @hpcc-js/form examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github hpcc-systems / Visualization / tests / test-form / src / form.spec.ts View on Github external
case Radio:
                                break;
                            case CheckBox:
                                break;
                            case FieldForm:
                                render(new FieldForm()
                                    .fields([
                                        new Database.Field().id("fname").label("First Name"),
                                        new Database.Field().id("lname").label("Last Name"),
                                        new Database.Field().id("age").label("Age")
                                    ])
                                    .data([["Joe", "Bloggs", 42]])
                                );
                                break;
                            case Form:
                                render(new Form()
                                    .inputs([
                                        new Input()
                                            .name("textbox-test")
                                            .label("Alphanumeric")
                                            .type("text")
                                            .validate("^[A-Za-z0-9]+$")
                                            .value("SomeString123"),
                                        new InputRange()
                                            .name("textbox-range-test")
                                            .label("Range")
                                            .value(["SomeString001", "SomeString100"]),
                                        new Input()
                                            .name("number-test")
                                            .label("Number Test")
                                            .type("number")
                                            .validate("\\d+")
github hpcc-systems / Visualization / demos / WeCare / src / index.ts View on Github external
.type("textarea")
            .value(99501)
            .on("change", function (w) {
                context.refreshLocations();
            })
            ;
        this.formZip3 = new Input()
            .name("zip3")
            .label("Location 3")
            .type("textarea")
            .value("")
            .on("change", function (w) {
                context.refreshLocations();
            })
            ;
        this.form = new Form()
            .target(id)
            .inputs([
                new WidgetArray()
                    .content([
                        this.formZip1,
                        new Input()
                            .name("zip1Date")
                            .label("Date")
                            .type("date")
                            .value("2005-10-05")
                            .on("change", function (w) {
                                context.formatDate(w);
                            }),
                        new Input()
                            .name("zip1DateRange")
                            .label("+/- Months")
github hpcc-systems / Visualization / demos / WeCare / src / index.ts View on Github external
context.refreshLocations();
                }
            })
            ;
        this.formZip3 = new Input()
            .name("zip3")
            .label("Location 3")
            .type("textarea")
            .value("")
            .on("change", function (w, complete) {
                if (complete) {
                    context.refreshLocations();
                }
            })
            ;
        this.form = new Form()
            .target(id)
            .inputs([
                new WidgetArray()
                    .content([
                        this.formZip1,
                        new Input()
                            .name("zip1Date")
                            .label("Date")
                            .type("date")
                            .value("2005-10-05")
                            .on("change", function (w, complete) {
                                if (complete) {
                                    context.formatDate(w);
                                }
                            }),
                        new Input()