Commit 38a122c7d726c9dc5588fc5a7e346e0497ed61e0

Authored by David RENÉ
1 parent b28918c2

add radio has preset of input

add label
Showing 1 changed file with 16 additions and 0 deletions   Show diff stats
web/CXM_making_a_web_site.anubis
@@ -1447,10 +1447,20 @@ public define HTML_Off_Form iframe(String src) @@ -1447,10 +1447,20 @@ public define HTML_Off_Form iframe(String src)
1447 public define HTML_Off_Form input(List(CoreAttrs) attrs) = html_void_tag("input", attrs). 1447 public define HTML_Off_Form input(List(CoreAttrs) attrs) = html_void_tag("input", attrs).
1448 public define HTML_Off_Form input(CoreAttrs attr) = html_void_tag("input", [attr]). 1448 public define HTML_Off_Form input(CoreAttrs attr) = html_void_tag("input", [attr]).
1449 1449
  1450 + //-- BEGIN of <input> preset type
  1451 +
  1452 + /// Radio button
  1453 +public define HTML_Off_Form radio(List(CoreAttrs) attrs, String name, String value, String form, Bool checked) = input([attr("type","radio"), attr("name",name), attr("value",value), attr("form", form), bool_attr(checked, "checked") . attrs]).
  1454 +public define HTML_Off_Form radio(List(CoreAttrs) attrs, String name, String value, String form) = radio(attrs, name, value, form, false).
  1455 +public define HTML_Off_Form radio(String name, String value, String form, Bool checked) = radio([], name, value, form, checked).
  1456 +public define HTML_Off_Form radio(String name, String value, String form) = radio([], name, value, form, false).
  1457 +
  1458 + /// hidden value
1450 public define HTML_Off_Form hidden(List(CoreAttrs) attrs, String name, String value, String form) = input([attr("type","hidden"), attr("name",name), attr("value",value), attr("form", form) . attrs]). 1459 public define HTML_Off_Form hidden(List(CoreAttrs) attrs, String name, String value, String form) = input([attr("type","hidden"), attr("name",name), attr("value",value), attr("form", form) . attrs]).
1451 public define HTML_Off_Form hidden(CoreAttrs attr, String name, String value, String form) = hidden([attr], name, value, form). 1460 public define HTML_Off_Form hidden(CoreAttrs attr, String name, String value, String form) = hidden([attr], name, value, form).
1452 public define HTML_Off_Form hidden(String name, String value, String form) = hidden([], name, value, form). 1461 public define HTML_Off_Form hidden(String name, String value, String form) = hidden([], name, value, form).
1453 1462
  1463 + //-- END of <input> preset type
1454 1464
1455 // <img> 1465 // <img>
1456 public define HTML_Off_Form img(List(CoreAttrs) attrs, String src, String alt) = html_void_tag("img", attrs + [attr("src",src), attr("alt",alt)] ). 1466 public define HTML_Off_Form img(List(CoreAttrs) attrs, String src, String alt) = html_void_tag("img", attrs + [attr("src",src), attr("alt",alt)] ).
@@ -1467,6 +1477,12 @@ public define HTML_Off_Form img(List(CoreAttrs) attrs, String src, String alt, I @@ -1467,6 +1477,12 @@ public define HTML_Off_Form img(List(CoreAttrs) attrs, String src, String alt, I
1467 public define HTML_Off_Form img(CoreAttrs _attr, String src, String alt, Int width, Int height) = 1477 public define HTML_Off_Form img(CoreAttrs _attr, String src, String alt, Int width, Int height) =
1468 html_void_tag("img", [_attr, attr("src",src), attr("alt",alt), attr("width",to_String(width)+"px"), attr("height",to_String(height)+"px")]). 1478 html_void_tag("img", [_attr, attr("src",src), attr("alt",alt), attr("width",to_String(width)+"px"), attr("height",to_String(height)+"px")]).
1469 1479
  1480 + // <label>
  1481 +public define HTML_Off_Form label(List(CoreAttrs) attrs, List(HTML_Off_Form) content) = html_tag("label", attrs, content).
  1482 +public define HTML_Off_Form label(CoreAttrs attr, List(HTML_Off_Form) content) = html_tag("label", [attr], content).
  1483 +public define HTML_Off_Form label(List(HTML_Off_Form) content) = html_tag("label", [], content).
  1484 +public define HTML_Off_Form label(HTML_Off_Form content) = html_tag("label", [], [content]).
  1485 +
1470 // <li> 1486 // <li>
1471 public define HTML_Off_Form li(List(CoreAttrs) attrs, List(HTML_Off_Form) content) = html_tag("li", attrs, content). 1487 public define HTML_Off_Form li(List(CoreAttrs) attrs, List(HTML_Off_Form) content) = html_tag("li", attrs, content).
1472 public define HTML_Off_Form li(List(CoreAttrs) attrs, HTML_Off_Form content) = html_tag("li", attrs, [content]). 1488 public define HTML_Off_Form li(List(CoreAttrs) attrs, HTML_Off_Form content) = html_tag("li", attrs, [content]).