From 38a122c7d726c9dc5588fc5a7e346e0497ed61e0 Mon Sep 17 00:00:00 2001 From: totoro Date: Sun, 10 May 2020 01:53:02 +0900 Subject: [PATCH] add radio has preset of input add label --- web/CXM_making_a_web_site.anubis | 16 ++++++++++++++++ 1 file changed, 16 insertions(+), 0 deletions(-) diff --git a/web/CXM_making_a_web_site.anubis b/web/CXM_making_a_web_site.anubis index 7ad36f8..22a76ce 100644 --- a/web/CXM_making_a_web_site.anubis +++ b/web/CXM_making_a_web_site.anubis @@ -1447,10 +1447,20 @@ public define HTML_Off_Form iframe(String src) public define HTML_Off_Form input(List(CoreAttrs) attrs) = html_void_tag("input", attrs). public define HTML_Off_Form input(CoreAttrs attr) = html_void_tag("input", [attr]). + //-- BEGIN of preset type + + /// Radio button +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]). +public define HTML_Off_Form radio(List(CoreAttrs) attrs, String name, String value, String form) = radio(attrs, name, value, form, false). +public define HTML_Off_Form radio(String name, String value, String form, Bool checked) = radio([], name, value, form, checked). +public define HTML_Off_Form radio(String name, String value, String form) = radio([], name, value, form, false). + + /// hidden value 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]). public define HTML_Off_Form hidden(CoreAttrs attr, String name, String value, String form) = hidden([attr], name, value, form). public define HTML_Off_Form hidden(String name, String value, String form) = hidden([], name, value, form). + //-- END of preset type // 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 public define HTML_Off_Form img(CoreAttrs _attr, String src, String alt, Int width, Int height) = html_void_tag("img", [_attr, attr("src",src), attr("alt",alt), attr("width",to_String(width)+"px"), attr("height",to_String(height)+"px")]). + //