El problema no es PHP, mucho menos Javascript, sino HTML, porque no puedes tener formularios anidados.
Cita: https://www.w3.org/MarkUp/html3/forms.html
Every form must be enclosed within a FORM element. There can be several forms in a single document, but
the FORM element can't be nested. The browser is responsible for handling the input focus, i.e. which field will currently get keyboard input. Many platforms have existing conventions for forms, for example, using Tab and Shift-Tab to move the keyboard focus forwards and backwards between fields, and using the Enter (aka Return) key to submit the form.