1.8.4.3 web.form.field.extra -- Extra fields for use with web.form

This module provides two classes: URL and Email. Both these classes behave exactly the same as the web.form.field.typed.String class except that they only accept as values strings that are URLs or Emails respectively.

For example:

>>> import web.form.field.extra as field
>>> email = field.Email(name='emailField')
>>> print email.html()
<input type="text" name="emailField" value=""> <small>eg. james@example.com</small>
>>> email.value = 'this is not an email address'
>>> email.valid()
0
>>> print email.error()
Please enter a valid email address. eg. james@example.com
>>> email.setError('')
>>> email.value = 'james@example.com'
>>> email.valid()
1