Proper output for hidden fields in front-end forms. Fixes #1946, using suggested fix by @scottkclark in #1947