4

I have a case where I need to use a numeric field which also has a default value.

For example: numericField needs to have a minimum value of 100 and a max value of 1000, but when the user adds a new entry, the field value should default to 256 in the entry form.

Unfortunately, I cannot trust the user to enter the correct default value, even if it is clearly indicated in the field notes.

Right now, when the user adds a new entry, numericField will always be set to 100 the minimum value.

Is there another integer field type which would work as I have described?

1 Answer 1

2

You can:

1) Write a plugin that extends Craft's native Number field type and adds the functionality you're looking for.

2) Make a feature request for a default value for the native Number field type.

3) Potentially fake it using something like the CP CSS plugin.

1
  • Thanks, Brad. I added a feature request for this. Using a plugin for this seems like overkill. Commented Aug 5, 2015 at 16:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.