I have tested a few things and have found that I am unable to get the length with the onLiveChange. We will look into this to see if this is a limitation of the event or a bug in the sw. As an alternative you could use the onChange event and test against JS if statements or even use a regex pattern. If the condition you want is not met you can then set the item to invalid (i.e. BO.F_Password1.setValid(false, “passwords must be between 4 and 20 characters”) ) and also set the button to setActive(false).
When using onLiveItemChange the getValue() function will always return empty. Instead you need to use getDisplayValue(), this will return you what has currently been entered, as the value at the data layer has not been registered. I hope that this simple change will enable you to move forward.