Tayra

Template. Script. Distribute

forms – Handlers for custom form tags

Module provides a plugin to handle custom tags for html5 forms. Following is a table of token-specifiers that are common to all tags handled by this plugin, and augment the standard set of specifiers provided by tayra.tags.Tags base class.

token Equivalent attribute pairs
on autocomplete=”on”
off autocomplete=”off”
autofocus autofocus=”autofocus”
application/ x-www-form-urlencoded enctype=”application/x-www-form-urlencoded”
multipart/form-data enctype=”multipart/form-data”
text/plain enctype=”text/plain”
get formmethod=”get”
post formmethod=”post”
novalidate formnovalidate=”novalidate”
required required=”required”
checked checked=”checked”
hard wrap=”hard”
soft wrap=”soft”
[<item1>,<item2>] list=”<item1>,<item2>”
<pattern> or %<pattern>% pattern=”<pattern>”
h:<placeholder> placeholder=”<placeholder>”
f:<formname> form=”<formname>”
a:<formaction> formaction=”<formaction>”
min < step < max min=”<min>” step=”<step>” max=”<max>”
min < max min=”<min>” max=”<max>”
<maxlength>:<size> maxlength=”<maxength>” size=”<size>”
<width>,<height> height=”<height>” width=”<width>”
  • if placeholder string has several words seperated by white-space, replace spaces with + character. If help string is more complicated containing several special characters it is better to avoid h:... format and define them directly as an attribute.
  • a quoted string is interpreted as value attribute and translated to value=<string>.
  • If action-url contains white-spaces, replace them with + character.

Module contents

class tayra.tags.forms.HTML5Forms(pa, *args, **kwargs)[source]

Bases: tayra.tags.Tags

Plugin to handle HTML input elements and other form tags like, textarea and select. It also provides a common set of token specifiers described by this module documentation. To know more about tokens specific to each tags refer to the corresponding handler function.

tag_inpbutton(mach, tagname, tokens, styles, attributes, content)[source]

<input type=”button”> handler

tag_inpchk(mach, tagname, tokens, styles, attributes, content)[source]

<input type=”check”> handler

tag_inpcolor(mach, tagname, tokens, styles, attributes, content)[source]

<input type=”color”> handler

tag_inpdate(mach, tagname, tokens, styles, attributes, content)[source]

<input type=”date”> handler

tag_inpdt(mach, tagname, tokens, styles, attributes, content)[source]

<input type=”datetime”> handler

tag_inpdtlocal(mach, tagname, tokens, styles, attributes, content)[source]

<input type=”datetime-local”> handler

tag_inpemail(mach, tagname, tokens, styles, attributes, content)[source]

<input type=”email”> handler

tag_inpfile(mach, tagname, tokens, styles, attributes, content)[source]

<input type=”file”> handler

tag_inphidden(mach, tagname, tokens, styles, attributes, content)[source]

<input type=”hidden”> handler

tag_inpimg(mach, tagname, tokens, styles, attributes, content)[source]

<input type=”image”> handler

tag_inpmonth(mach, tagname, tokens, styles, attributes, content)[source]

<input type=”month”> handler

tag_inpnum(mach, tagname, tokens, styles, attributes, content)[source]

<input type=”number”> handler

tag_inppass(mach, tagname, tokens, styles, attributes, content)[source]

<input type=”password”> handler

tag_inpradio(mach, tagname, tokens, styles, attributes, content)[source]

<input type=”radio”> handler

tag_inprange(mach, tagname, tokens, styles, attributes, content)[source]

<input type=”range”> handler

tag_inpreset(mach, tagname, tokens, styles, attributes, content)[source]

<input type=”reset”> handler

tag_inpsearch(mach, tagname, tokens, styles, attributes, content)[source]

<input type=”search”> handler

tag_inpsub(mach, tagname, tokens, styles, attributes, content)[source]

<input type=”submit”> handler

tag_inptel(mach, tagname, tokens, styles, attributes, content)[source]

<input type=”tel”> handler

tag_inptext(mach, tagname, tokens, styles, attributes, content)[source]

<input type=”text”> handler

tag_inptime(mach, tagname, tokens, styles, attributes, content)[source]

<input type=”time”> handler

tag_inpurl(mach, tagname, tokens, styles, attributes, content)[source]

<input type=”url”> handler

tag_inpweek(mach, tagname, tokens, styles, attributes, content)[source]

<input type=”week”> handler

tag_select(mach, tagname, tokens, styles, attributes, content)[source]

<select> handler. Supported tokens,

  • autofocus atom translates to autofocus="autofocus".
  • If a token is of the form f:formname it will be translated to form="formname".
  • Otherwise the atom is interpreted as integer size, and translated to size="size".

Table Of Contents

Related Topics

This Page