adds logic around hidden form field for edit.