Demo: Text Input Widget

Enter some text (python will be highlighted)

Captured submission


      
    @view_config(name="textinput",
                 renderer="templates/form.pt",
                 route_name="unofficial-deformdemo")
    @demonstrate("Text Input Widget")
    def textinput(self):
        class Schema(colander.Schema):
            text = colander.SchemaNode(
                colander.String(),
                validator=colander.Length(max=100),
                widget=deform.widget.TextInputWidget(),
                description="Enter some text (python will be highlighted)",
            )

        schema = Schema()
        form = deform.Form(schema, buttons=("submit",))

        return self.render_form(form)