diff options
-rw-r--r-- | lib/basis.lig | 1 | ||||
-rw-r--r-- | src/monoize.sml | 3 | ||||
-rw-r--r-- | tests/pass.lac | 13 |
3 files changed, 16 insertions, 1 deletions
diff --git a/lib/basis.lig b/lib/basis.lig index 913e6af4..94977faf 100644 --- a/lib/basis.lig +++ b/lib/basis.lig @@ -66,6 +66,7 @@ con lformTag = fn ty :: Type => fn inner :: {Unit} => fn attrs :: {Type} => -> nm :: Name -> unit -> tag attrs ([LForm] ++ ctx) inner [] [nm = ty] val textbox : lformTag string [] [] +val password : lformTag string [] [] val ltextarea : lformTag string [] [] con radio = [Body, Radio] diff --git a/src/monoize.sml b/src/monoize.sml index c193e611..1dcef40a 100644 --- a/src/monoize.sml +++ b/src/monoize.sml @@ -259,7 +259,7 @@ fun monoExp (env, st) (all as (e, loc)) = fun input typ = case targs of - [(L.CName name, _)] => + [_, (L.CName name, _)] => (L'.EStrcat (tagStart "input", (L'.EPrim (Prim.String (" type=\"" ^ typ ^ "\" name=\"" ^ name ^ "\"/>")), loc)), loc) @@ -304,6 +304,7 @@ fun monoExp (env, st) (all as (e, loc)) = loc)), loc) | _ => (Print.prefaces "Targs" (map (fn t => ("T", CorePrint.p_con env t)) targs); raise Fail "No name passed to textarea tag")) + | "password" => input "password" | "ltextarea" => (case targs of [_, (L.CName name, _)] => diff --git a/tests/pass.lac b/tests/pass.lac new file mode 100644 index 00000000..2260267a --- /dev/null +++ b/tests/pass.lac @@ -0,0 +1,13 @@ +val handler = fn r => <html><body> + <li> Name: {cdata r.Nam}</li> + <li> Password: {cdata r.Word}</li> +</body></html> + +val main : unit -> page = fn () => <html><body> + <lform> + Name: <textbox{#Nam} /><br/> + Password: <password{#Word} /><br/> + + <submit action={handler}/> + </lform> +</body></html> |