I am working on a Form for a customer that has a number of dynamic aspects. I have half a dozen select elements that all change values based on the previous choice, and this is working well. I was asked if, based on the choice from an earlier select field (Operating System), we could disable several other select fields. I’ve tried a couple of different ways, such as this:
New-UDSelect -Label "OS" -Id "OS" -Option {
foreach ($item in $aFields) {
if (!([string]::IsNullOrEmpty($item.OS))) {
New-UDSelectOption -Name "$($item.OS)" -Value "$($item.OS)"
}
}
} -OnChange {
Set-UDElement -Id "Drive2Letters" -Disabled
}
I also tried something like this:
} -OnChange {
Set-UDElement -Id "Drive2Letters" -Properties @{Disabled = $true}
}
But I just don’t seem to be hitting the syntax correctly. Has anyone successfully done this before?
Product: PowerShell Universal
Version: 1.5.8