1 - The attribute disabled
is an attribute to indicate what its name says 'desabilitato'
, that is, he will not be skilled within form.
2 - Even with the attribute disabled
, the value appears, in your case is not showing as the property 'value'
is without the '='
, just correct to:
value="123456,78"
3 - To have a non-enterable input that is accounted for by the form, use the attribute 'readonly'
, which also means the proper name 'read only', with this attribute the value of the field is not editable, but is skilled within the form.
Your correct input (If you want to submit the data via form) should be:
<input type="text" name="anterior" id="anterior" size="13" maxlength="50" value="123456,78" readonly />
And another option (if you don’t want the data to be submitted via form) should be:
<input type="text" name="anterior" id="anterior" size="13" maxlength="50" value="123456,78" disabled='disabled' />
Review your example, it seems to contrast with your explanation
– MagicHat
I left my -1 because, in my view, the problem is not related to the fact that the field is disabled, as he put it in the answer. In it he hints that a field disabled cannot receive value and this makes no sense. The only problem in the question code is the absence of the equal in the attribute
value
.– Woss
Yes, I only commented for knowledge.
– Allan Kehl