A form mask takes a FormField instance as an input and returns some HTML code as output. Don't forget that your mask should be setting the value of the field according the the currentValue member variable. Moreover, it should handle the field differently if the errorMessage is set.
For instance, a mask for a text field could look like this:
if field.typ=='text': result='%s: <input type=text name="%s" value="%s" size="%s">'%( field.label, field.name, field.currentValue, field.size) if field.errorMessage: result+=' <font color=red>%s</font>'%field.errorMessage return result+'<br>'
Things are a bit trickier for select boxes, radio buttons or checkboxes because you have to loop over the optionList member variable and match each value against currentValue.
For instance, for a select box, the mask could look like this:
if field.typ=='select': result='%s: <select name="%s" size="%s">'%(field.label, field.name, field.size) for optionValue in optionList: if optionValue==field.currentValue: checked=' checked' else: checked='' result+='<option%s>%s</option>'%(checked,optionValue) result+='</select> if field.errorMessage: result+=' <font color=red>%s</font>'%field.errorMessage return result+'<br>'
See About this document... for information on suggesting changes.