0
When I send this html code via ajax it displays correctly, but closes the Form tag right after opening it, is there another way to do this? or there is some syntax error.
$FormUserCad = '<div class="Ctn_Form_Cad">
<div class="input_form_cad">
<div>
<div><form action="oi.php" method="post"></div>
<div><label>Nome:<label></div>
<div><input name="nome" type="text"></div>
</div>
<div>
<div><label>Idade:<label></div>
<div><input type="text"></div>
</div>
</div>
<div class="input_form_cad">
<div>
<div><label>Rua:<label></div>
<div><input type="text"></div>
</div>...
</form> <--
$retorno = array('codigo' => 0, 'mensagem' => $FormUserCad);
echo json_encode($retorno);
exit();
But if you open one
form
, it has to be closed even by logic, otherwise your form will not work. I don’t understand your doubt.– viana
it closes itself, example <form action="hi"></form> not at the end of the code as desired, and it removes the </form> from the end of the code
– Felipe Duarte
Every HTML element that opens will be closed by the browser, regardless of whether you closed correctly or not, the browser constructs a terminal from the last closed element correctly. And yes, it is a syntax error to leave your html tag open. Even it also takes the freedom to move your place element, as for example if you put a src script, below the browser, outside the body, it will fix by placing it inside the body.
– Ivan Ferrer