0
I have a form where you place purchase orders when the user chooses the product it brings the price automatically, the problem is that the unit value field is free for changes and I need to block this field.
I tried the normal which is readonly="readonly" but it continues allowing changes.
I tried with disabled this disables the field for changes but also does not save this value in bd
What other way to block the field and write in the bd that value received in the product selection?
PS: I have other fields in this form that use readonly="readonly" that works perfectly as for example the result of multiplying Qtd by unit price the total field of the item the user can not change
the form is like this:
<td>
<input name="valor_unid[]" type="text" required name="valor_unid"
maxlength="30" size="11" style="text-align:center" class="valor_unid" />
</td>
Tried using javascript like this Document.getElementById("myText"). readonly = true;
– Thi100
Ever tried to put "disable"? (without the quotation marks).
– Leandro
I believe you are giving some error because you are using readonly="readonly", try to put only
readonly
This answer has some things you may be interested in https://answall.com/questions/313349/existe-diff%C3%A7a-in-use-attributes-Html5-with-or-without-true-false/– hugocsl
Leandro already used disable without quotes and even so it does not record in BD Hugocsl I tried also only readonly and even so lets change
– Robert
If you can take the input, put the value inside a
<p></p>
– Leandro
Without the imput the value will not appear on the screen
– Robert
Puts type="Hidden" in the input and puts the value out of the field as well.
– Sam
dvd.... thank you hadn’t thought of that possibility...
– Robert