Commit 16555932600f50d91f43404874ca912def19ec57
1 parent
efbef67a
HTML_Off_Form
[+] checkbox [+] more option
Showing
1 changed file
with
13 additions
and
6 deletions
Show diff stats
web/making_a_web_site.anubis
| ... | ... | @@ -1354,7 +1354,7 @@ public define CoreAttrs formmethod(FormMethod method) = attr("formmethod", if me |
| 1354 | 1354 | 'HTML_Off_Form' defines all the elements you may put outside any form. |
| 1355 | 1355 | |
| 1356 | 1356 | |
| 1357 | -public define CoreAttrs method(String value) = attr("method", value). | |
| 1357 | +public define CoreAttrs method(String value) = attr("method", value). | |
| 1358 | 1358 | public define CoreAttrs action(WEB_Action_Name action)= attr("action", "/"+format_web_action_name(action)). |
| 1359 | 1359 | public define CoreAttrs action(WEB_Action_Name action, List((String,String)) extra_ops)= attr("formaction", "/"+format_web_action_name(action, extra_ops)). |
| 1360 | 1360 | public define CoreAttrs formmethod(String value) = attr("formmethod", value). |
| ... | ... | @@ -1562,6 +1562,12 @@ public define CoreAttrs name(String value)= attr("name", value). |
| 1562 | 1562 | public define CoreAttrs value(String value)= attr("value", value). |
| 1563 | 1563 | public define CoreAttrs init(String value)= attr("value", encode_HTML_entities(value)). |
| 1564 | 1564 | //-- BEGIN of <input> preset type |
| 1565 | + | |
| 1566 | + /// Checkbox | |
| 1567 | +public define HTML_Off_Form checkbox(List(CoreAttrs) attrs, String name, String form, Bool checked) = input([type("checkbox"), attr("name",name), attr("form", form), bool_attr(checked, "checked") . attrs]). | |
| 1568 | +public define HTML_Off_Form checkbox(List(CoreAttrs) attrs, String name, Bool checked) = input([type("checkbox"), attr("name",name), bool_attr(checked, "checked") . attrs]). | |
| 1569 | +public define HTML_Off_Form checkbox(String name, String form, Bool checked) = checkbox([], name, form, checked). | |
| 1570 | +public define HTML_Off_Form checkbox(String name, Bool checked) = checkbox([], name, checked). | |
| 1565 | 1571 | |
| 1566 | 1572 | /// Radio button |
| 1567 | 1573 | public define HTML_Off_Form radio(List(CoreAttrs) attrs, String name, String value, String form, Bool checked) = input([type("radio"), attr("name",name), attr("value",value), attr("form", form), bool_attr(checked, "checked") . attrs]). |
| ... | ... | @@ -1635,11 +1641,12 @@ public define HTML_Off_Form ol(List(HTML_Off_Form) content) |
| 1635 | 1641 | public define HTML_Off_Form ol(HTML_Off_Form content) = html_tag("ol", [], [content]). |
| 1636 | 1642 | |
| 1637 | 1643 | // <option> |
| 1638 | -public define HTML_Off_Form option(List(CoreAttrs) attrs, List(HTML_Off_Form) content) = html_tag("option", attrs, content). | |
| 1639 | -public define HTML_Off_Form option(List(CoreAttrs) attrs, HTML_Off_Form content) = html_tag("option", attrs, [content]). | |
| 1640 | -public define HTML_Off_Form option(List(HTML_Off_Form) content) = html_tag("option", [], content). | |
| 1641 | -public define HTML_Off_Form option(HTML_Off_Form content) = html_tag("option", [], [content]). | |
| 1642 | - | |
| 1644 | +public define HTML_Off_Form option(List(CoreAttrs) attrs, List(HTML_Off_Form) content) = html_tag("option", attrs, content). | |
| 1645 | +public define HTML_Off_Form option(List(CoreAttrs) attrs, HTML_Off_Form content) = html_tag("option", attrs, [content]). | |
| 1646 | +public define HTML_Off_Form option(List(HTML_Off_Form) content) = html_tag("option", [], content). | |
| 1647 | +public define HTML_Off_Form option(CoreAttrs attr, HTML_Off_Form content) = html_tag("option", [attr], [content]). | |
| 1648 | +public define HTML_Off_Form option(HTML_Off_Form content) = html_tag("option", [], [content]). | |
| 1649 | +public define HTML_Off_Form option(String _value, String _text) = html_tag("option", [value(_value)], [text(_text)]). | |
| 1643 | 1650 | // <p> |
| 1644 | 1651 | public define HTML_Off_Form p(List(CoreAttrs) attrs, List(HTML_Off_Form) content) = html_tag("p", attrs, content). |
| 1645 | 1652 | public define HTML_Off_Form p(List(CoreAttrs) attrs, HTML_Off_Form content) = html_tag("p", attrs, [content]). | ... | ... |