diff --git a/templates/components/Text.hnb b/templates/components/Text.hnb index fe64cdf..be44133 100644 --- a/templates/components/Text.hnb +++ b/templates/components/Text.hnb @@ -1,14 +1,15 @@ -// ReflectedForm instance -//param $form +declare + // ReflectedForm instance + param $form -// The name of the form field -//param $name + // The name of the form field + param $name -// Optional. Override the type of the textbox. -// Example values: 'password' -// For email, prefer instead to have an Email validator on the field -// and this will be set automatically. -//TODO param $type = "text" + // Optional. Override the type of the textbox. + // Example values: 'password' + // For email, prefer instead to have an Email validator on the field + // and this will be set automatically. + param $type = "text" set $minlength = None @@ -16,7 +17,6 @@ set $maxlength = None set $required = None set $email = None set $pattern = None -set $type = "text" for $validator in $form.info.field_validators($name) match $validator diff --git a/templates/pages/login.hnb b/templates/pages/login.hnb index d3d9daa..c746fec 100644 --- a/templates/pages/login.hnb +++ b/templates/pages/login.hnb @@ -1,10 +1,9 @@ BarePage form {method = "POST"} - Text {$form, name = "username"} "UN" - input {type = "text", name = "username"} + Text {$form, name = "username"} " PW" - input {type = "password", name = "password"} + Text {$form, name = "password", type = "password"} " " input {type = "hidden", name = "xsrf", value = $xsrf_token} button {type = "submit"}