0
I intend to create a input
to insert cell phone contacts.
<h5>
<strong>Contato</strong>
</h5>
<input type="text" id="Contato" name="Contato" value="351"
style="width:150px" required />
I want the 351 code not to be possible for the user to delete it, but to be able to add the customer’s number in front, for example, 35191234455xx. When inserting into the table, you must enter the code and the number.
You are asking for help so that an input value is fixed and cannot be modified, but you are also saying that it has to be possible to add the customer’s contact on
input
. Could you clarify this better? This fixed field is field that the customer has to change?– fernandosavio
@fernandosavio I intend that the indicative 351 it is not possible for the user to delete it, but it is possible to add the customer’s number in front, for example, 35191234455xx. When inserting into the table, you must enter the code and the number
– Bruno
Now it’s easier to understand, the
351
is a required prefix of the field, and the user can fill in the rest. Question, are you using any CSS framework? Tip: Edit your question and put this last piece of information you gave me, because it’s critical to understand your problem.– fernandosavio
@fernandosavio I am not using any CSS framework
– Bruno
And why not present the value out of of
<input>
and add it to the backend? Put that figure in a<span>
, for example.– Woss
@Anderson Carlos Woss, I used your tip, thanks. Just a doubt, and when entering in the database, also inserts the value that is within the
<span>
?– Bruno
You’re not inserting what’s inside the span. What @Andersoncarloswoss meant is that when entering into the database, you include the number + what was typed, for example:
insert into tabela (telefone) values ('351$telefone')
...– Sam