Need New-UDInputField type checkbox with default checked

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 …

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

1 Like

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
              }
2 Likes

Have the same question :wink:

I got the same question guys, anything to share?

I am looking for the same option.

To loop back already, an option of -DefaultValue $true will default the checkbox to checked, as I found. As an example:

New-UDInputField -Name SendEmail -Type checkbox -DefaultValue $true -Placeholder "Email the user?"