I have an HTML page which is partially built with PHP.
The issue is that I have a form where using HTML I have a textbox where with the method onchange="this.form.submit()"
where an identification number is written down. With a php code, when sending this textbox and if the length of its content is greater than 0
, a second textbox appears where the user must register a name and in turn, with the method onchange="this.form.submit()"
, when it is sent a third appears textbox where the last name of the person is written down.
Obviously each time the page is reloaded each textbox retains its content.
The problem is that in the case of the second textbox, where the name of the person must be written down, if for example, "Juan Jose"
is placed when reloading, only "Juan"
appears. I want to show "Juan Jose", that is, all the words. The code I use is the following:
<b>CI:</b> <input type="text" name="cedula" id="cedula" onchange="this.form.submit()" onblur="copiar()" value="<?php $cedul = isset($_POST['cedula']) ? $_POST['cedula'] : null ; echo $cedul;?>"/>
<?php
$cedul = isset($_POST['cedula']) ? $_POST['cedula'] : null ;
if (strlen($cedul)>0) {
$nombr = isset($_POST['nombre']) ? $_POST['nombre'] : null ;
echo "<b>Nombre:</b> <input type='text' name='nombre' id='nombre' onchange='this.form.submit()' value=$nombr ></>";
}
$nombr = isset($_POST['nombre']) ? $_POST['nombre'] : null ;
$apellid = isset($_POST['apellido']) ? $_POST['apellido'] : null ;
if (strlen($nombr)>0) {
echo "<b>Apellido:</b> <input type='text' name='apellido' id='nombre' id='apellido' onchange='this.form.submit()' value= $apellid> </>";
}
... Any help is appreciated. Greetings.