Escape the value of the hidden field holding the focused element id

(cherry picked from commit 149cc36f30bcd3b31b727941f701e12ecbe3440f)