@view_config(renderer="templates/form.pt", name="checkedinput_withmask")
@demonstrate("Checked Input Widget (with Input Mask)")
def checkedinput_withmask(self):
widget = deform.widget.CheckedInputWidget(
subject="SSN",
confirm_subject="Confirm SSN",
mask="999-99-9999",
mask_placeholder="#",
)
class Schema(colander.Schema):
ssn = colander.SchemaNode(
colander.String(),
widget=widget,
title="Social Security Number",
description="Type your Social Security Number and confirm it",
)
schema = Schema()
form = deform.Form(schema, buttons=("submit",))
return self.render_form(form)