I have a database table which contains swedish corporate identity numbers (in lack of better translation).
It is in the form of: 123456-9999
Although, in the database, I want it without the hyphen, so I remove it with a callback (containing a basic str_replace) used on callback_before_insert/update.
The field in the database is a char(10), so the input field generated has a max length of 10. And here comes the twist - I want users to be able to input numbers *with* the hyphen.
Easy to fix, I use a callback_add/edit_field to create an input with max length 11 instead.
But, the problem I get is that when clicking on "View" (which points to the "read" method), there is all of a sudden an input field.
I can change the value to whatever - but of course I can't save it. It's not a problem from a security perspective, but it doesn't look so good.
The callback_add/edit_field should not change anything for the "read" method. Or am I wrong?