Kind of meaningless to type Olá mundo
in a field that will only accept numbers, but I will publish my reply
From what I saw in the code, who doesn’t let you type more than 4 characters is the one maxlength="4"
The attribute maxlength
specifies the maximum length of the value that can be inserted
So hello + a space add up to a length = 4
<a a class="arib">Origem: </a><input type="text" maxlength="4" placeholder="Origem" value="" name="origem" style="width:220px;"/>
Second comment from AP Eu havia digitado errado no exemplo acima, mas no meu código estava um 40, o que solucionou o problema foi a solução do amigo Wess acima,
I don’t think the problem was the lack of quotation marks on the value
, since value always has a value filled by php <?php echo $Origem; ?>
To prove I put an example below that even without quotes works to the satisfaction.
<a a class="arib">Origem: </a><input type="text" maxlength="40" placeholder="Origem" value=12 name="origem" style="width:50px;"/>
Put "var_dump($Origin)" in your code just before you use the variable. With this you will be able to know better if the problem is at echo time or if the variable is being distorted. If possible paste here your PHP code from the time of creation of the variable until the use of it.
– ivan veloso
There it is coming out full "Hello World", but the input keeps coming out only "Hello"
– Geraldão de Rívia
The code q I’m applying test is the top one, I ran the test with the phrase "Hello world" straight into the variable, and it was the same way
– Geraldão de Rívia
Test this in your code. <?php $Origin = "Hello World"; ? > <input type="text" placeholder="Origin" value="<? php echo $Origin; ?>"/>
– ivan veloso