Need New-UDInputField type checkbox with default checked

#1

Do use several Input fields pre-filling the Inputs (-Values/-DefaultValue;Type select).
Now I Need to have a Checkbox with Default checked …

New-UDInputField -Type checkbox -Name ‘Cluster’ -Placeholder “Do you want it clustered?”

How can I do this? “-DefaultValue $true” is not working …

#2

Looking through the documentation on https://docs.universaldashboard.io/components/checkbox it would seem you can do this by:-
Preformatted text New-UDCheckbox -Label Checked -Checked
Preformatted textNew-UDCheckbox -Label ‘Filled In’ -Checked -FilledIn

#3

you are right … but i am not using “New-UDCheckbox” i am using “New-IDInputField”
this one doesn´t have a Parameter checked …

New-UDcheckbox is working fine but not usable in “New-UDInput”

smal part of my code …

New-UDInput -Title “System hinzufügen …” -Id “Form” -Content {

              New-UDInputField -Type 'textbox' -Name 'Beschreibung' -Placeholder 'Beschreibung'                                    

              if ( $session:imagedefault -eq 'MariaDB' ) {
                 New-UDInputField -Type checkbox -Name 'Cluster' -Placeholder "Cluster über Standorte RZA/RZB" 
              } else {
                 New-UDInputField -Type 'select' -Name 'Middleware' -Placeholder 'Middleware' -Values $cache:middleware -DefaultValue $cache:middlewaredefault
              }
1 Like
#4

Have the same question :wink: