I am having an issue with the formvalidation on a checkbox not working in a dashboard.
New-UDCheckBox -Id "cb_Move" -Label "Ok To Move" -disabled
I enable it with a different control, which works correctly
The form validation looks like this
elseif(($eventdata.cb_Move).checked -ne "true"){
New-UDFormValidationResult -ValidationError "You must Check the OK box to start the move"
}
I have tried doing ($eventdata.cb_Move).checked -eq "false" and ($eventdata.cb_Move).checked -ne "$true" and neither of them seem to clear the form validation. The form keeps the error on the page and will not allow submission. I have also tried leaving it enabled, that does not make a difference.
I didn’t use the boolean variable since the value returned from the check box seems to be a string. I have another dashboard where the checkbox uses string, and it works.
elseif(($eventdata.cb_Empnum).checked -eq "true" -and $eventdata.tb_EmpID -eq $null){
New-UDFormValidationResult -ValidationError "You must enter an Employee ID"
}
In that dashboard if cb_Empnum is checked and tb_EmpID is empty it throws the error. If cb_Empnum is not checked I don’t get the error.