New-UDForm -OnValidate never enables Submit when the form contains a New-UDCheckBox

New-UDForm -OnValidate never enables Submit when the form contains a New-UDCheckBox

avatar

After upgrading to 2026.3.0, any New-UDForm that uses -OnValidate and contains a New-UDCheckBox leaves its Submit button permanently disabled.

Typing valid input, reloading the page and restarting the app make no difference. The same form without the checkbox works normally.

-OnValidate appears never to run in the broken case: a Show-UDToast placed at the top of the validator never fires, and reading the value with Get-UDElement instead of $EventData makes no difference.
The checkbox's -Checked state doesn't matter, and it reproduces with a single checkbox.

The two forms below are identical except that Test B has one extra line — the checkbox.
Type three or more characters into each: Test A enables Submit, Test B never does.

Environment: PowerShell Universal 2026.3.0, Linux container.

New-UDRow {

    New-UDColumn -LargeSize 6 -Content {
        New-UDCard -Title "Test A - textbox only" -Content {
            New-UDForm -Content {
                New-UDTextbox -Id 'TestA' -Label 'Type at least 3 characters' -FullWidth
            } -OnValidate {
                if ($EventData.TestA.Length -lt 3) {
                    New-UDFormValidationResult -ValidationError "Enter at least 3 characters"
                } else {
                    New-UDFormValidationResult -Valid
                }
            } -OnSubmit {
                Show-UDToast -Message "Test A submitted: '$($EventData.TestA)'" -Duration 4000 -Position topRight
            }
        }
    }

    New-UDColumn -LargeSize 6 -Content {
        New-UDCard -Title "Test B - same form plus a checkbox" -Content {
            New-UDForm -Content {
                New-UDTextbox -Id 'TestB' -Label 'Type at least 3 characters' -FullWidth
                New-UDCheckBox -Id 'TestBCheck' -Label 'A checkbox' -Checked $true
            } -OnValidate {
                if ($EventData.TestB.Length -lt 3) {
                    New-UDFormValidationResult -ValidationError "Enter at least 3 characters"
                } else {
                    New-UDFormValidationResult -Valid
                }
            } -OnSubmit {
                Show-UDToast -Message "Test B submitted: '$($EventData.TestB)'" -Duration 4000 -Position topRight
            }
        }
    }

}

All Comments (3)

avatar

Hello Nocturn,

Thank you for reaching out to the Devolutions support team.

An internal case is now open regarding this issue.

The problem is limited to New-UDCheckBox.

I tested New-UDSwitch and New-UDSelect in the same form, and both still work normally on 2026.3.0.

Here is what is happening, and why the two workarounds below avoid it.

The Submit button is controlled by the form's validation.

A form that uses -OnValidate starts in an invalid state, and Submit only unlocks once your validation script returns New-UDFormValidationResult -Valid.

When a checkbox is present, your validation script is never called at all.

Because it is never called, it can never return Valid, so Submit stays disabled forever.

That is also why your Show-UDToast never appeared, and why reloading the page or restarting the app makes no difference.

The first workaround removes the validation step, so nothing is holding the button locked.

You delete -OnValidate and check the value yourself inside -OnSubmit instead.

If the input is wrong, you show a message and return without doing any work.

The checkbox stays inside the form, and its value still arrives in $EventData as normal.

The trade-off is that Submit is always clickable, so the user only learns the input was wrong after clicking it.

The second workaround keeps your validation and simply moves the checkbox out of the form.

The form then contains only the textbox, which still validates correctly on 2026.3.0.

You read the checkbox separately inside -OnSubmit using Get-UDElement, because it is no longer part of $EventData.

The trade-off is that the checkbox appears just above the form rather than inside it.

I would suggest the second option if you want to keep the original behaviour where Submit stays disabled until the input is valid.

I am attaching a ready-to-run app that contains both options side by side, together with the broken version so you can compare all three directly.

One last point worth knowing, there is currently no 2026.3.1 container image published, so if you are running in a container these workarounds are the way forward for now.

Best regards,

Patrick Ouimet

UDForm-Checkbox-Workarounds.ps1

avatar

Hello Patrick,

Thanks. I will wait for the fix.
I have update to 2026.3.1 (docker: 2026.3.1-azure) , was not fixed there.

avatar

Hello Nocturn,

Thank you for confirming, and thank you for testing 2026.3.1.

Your result matches what we expected, so nothing on your side is wrong.

The issue is now tracked as a product defect, and the fix has already been written and merged (ticket PSU-1349, for internal reference only).

It is targeted for 2026.3.2, which has not been released yet.

2026.3.1 was published before the fix was written, so that build still carries the problem.

Until 2026.3.2 is out, the two workarounds I sent remain the way to keep your forms usable.

Moving the checkbox outside the form is the closer match to your original behaviour, because it keeps Submit locked until the text is valid.

I will follow up here as soon as 2026.3.2 is released, so you can confirm the fix on your side.

Best regards,

Patrick Ouimet