Update Text component to use declared params

This commit is contained in:
Olivier 'reivilibre 2025-05-26 21:52:54 +01:00
parent 0c617627fc
commit ea52283dfb
2 changed files with 12 additions and 13 deletions

View File

@ -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

View File

@ -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"}