I created a text field and select read-only widget but I cannot input a default value

Only local images are allowed.http://drupal.org/files/2013-03-30_07h44_16.png

CommentFileSizeAuthor
2013-03-30_07h44_16.png7.86 KBadrianmak

Comments

gillarf’s picture

Category: support » bug

Yes i noticed this too for a text field.

I think its a bug, so i've changed the category.

Setting the default value using text field widget, and then changing widget to read-only does not solve the problem.

Duplicate issue here:
https://drupal.org/node/1366762

joachim’s picture

Priority: Normal » Major

One way to do it is to switch the widget, edit the field to set the default, and switch the widget back again.

However, this is quite a fiddly process. Since field types have a default widget type set, perhaps this could be used as a fallback in the field settings form?

jpstrikesback’s picture

@joachim, I've found of late that this workaround no longer works where I am using FEWidgets...which is odd, so I back ported the widget from D8 over here #1465774: Provide a 'Hidden' field widget (which has the added benefit of being able to set a default value using a fields default widget)

FreeFox’s picture

I can confirm, read-only text field has no default value field. Switching to text field, setting default value and switching back doesn't work.

In a token I generate a code (xxx-xxx-xxx). I need to show that to the user but as read-only. Normally I put the token in the default field and it shows.

Without this fixed I can't use this module :(

loparr’s picture

Issue summary: View changes

still, not working. Does anybody maintain this module?

SeanA’s picture

This can be accomplished using Field Permissions and Field Readonly instead.