If this class used happyforms you'd get this for free. See many other examples in our code base that use happyforms.