So I have two forms, one is for creating and the other for editing. Both using
There’s one difference between both, which is the
code_product, that is generated via php’s
rand() function, used only when creating a product (so there’s no code_product input here).
And when editing it, the
code_product value is shown inside of an additional
input at the top of the entire
input mustn’t be edited.
Problem: Using the
disabled attribute makes it unreadable for php too.
Add an attribute called
readonly to your input elements. This way it cant be edited but still viewed as normal.
<input type="text" readonly />
For older browsers, you will need
<input type="text" readonly="readonly" />