Details
Description
> If you add an AutoCompleteTextField to a form and then attempt to remove the field from the form, the <input> field itself is removed but the generated <script> code remains. This causes a browser script error when the page is rendered.
The reason the JavaScript is still rendered is because the AutoCompleteTextField is also added to its parent Page in order for Ajax callbacks to work properly.
We need to remove the field from the page when the field is removed from its parent container.