The validation works as expected if that property is rendered in a regular section/dynamic layout. However, the validation does not work if the section is rendered as an overlay or modal dialog - it doesn't pick up the JS referenced in the harness for these cases. The modal dialog is being launched via a local flow action in my example.
Make sure your script is still being called in case of validating modaldialog elements. If not, try placing the script in 'UserWorkForm'. Ideally, the script should be executed if it's defined in the harness, in what context the modal-dialog is launched.
Post few screenshots so we understand your problem better.