<p>I just submitted a feature request to have an <code>entries.onBeforeEditEntry</code> event. This should make it possible to have default values for all sort of field types from a plugin.</p>

<p><a href="http://feedback.buildwithcraft.com/forums/285221-feature-requests/suggestions/7494886-raise-an-event-before-entry-is-edited-loaded-in-cp" rel="nofollow">Raise an event before entry is edited/loaded in CP</a></p>

CC BY-SA 3.0
2016-08-05T00:11:41.123Z
Apparently Brandon added a hook in response to your request. Does this now make it possible to set defaults? If so, could you perhaps expand your answer with a code sample?
Simon East
CC BY-SA 3.0
2015-04-08T14:24:55.643Z
2015-04-08T14:24:55.643Z
carlcs
<p>Here is a <strong><a href="https://craftcms.stackexchange.com/questions/10862/how-to-use-a-numeric-field-with-a-default-value">feature request to add a default value</a></strong> to the native Number field type – voting for it will hopefully bring this functionality to Craft CMS.</p>

<p>(Also, Brad Bell <a href="https://craftcms.stackexchange.com/a/10863/37">suggests another solution</a>: Write a plugin that extends Craft's native Number field type.) </p>

CC BY-SA 3.0
2016-10-31T16:08:49.780Z
2016-10-31T16:08:49.780Z
2017-04-13T12:50:59.930Z
Avant la lettre
<p>As far as I know, the only fields that allow defaults are those that extend the <a href="http://buildwithcraft.com/classreference/fieldtypes/BaseOptionsFieldType" rel="nofollow">BaseOptionsFieldType</a>, namely Dropdown, Multiselect, Checkboxes, and RadioButtons. You could change your lightswitch to one of these other fieldtypes and have a default value available.</p>

CC BY-SA 3.0
2014-09-26T17:38:46.390Z
2014-09-26T17:38:46.390Z
Douglas McDonald
<p>This seems so simple, but after reading over the docs, I couldn't find an answer:</p>

<p>Is there a way to have a field have a default value in Craft?</p>

<p>In my case, I have a Lightswitch field that I want to be on by default, so my client doesn't have to turn it on every time they publish an asset.  But they still do need the ability to turn it off in exceptional cases.</p>

<p>I realize I could just reverse the logic of the field, but it raises a broader question of default field values (which would be useful to me).</p>

<field><fieldtypes>
Default field values?
# Default field values?

(Asked by: username_0 on 2014-09-26)

This seems so simple, but after reading over the docs, I couldn't find an answer:

Is there a way to have a field have a default value in Craft?

In my case, I have a Lightswitch field that I want to be on by default, so my client doesn't have to turn it on every time they publish an asset. But they still do need the ability to turn it off in exceptional cases.

I realize I could just reverse the logic of the field, but it raises a broader question of default field values (which would be useful to me).

**Tags:** field, fieldtypes


---

## 3 answers

### Answer by username_4 on 2014-09-26. Score: 4 | Accepted answer

As far as I know, the only fields that allow defaults are those that extend the [BaseOptionsFieldType](http://buildwithcraft.com/classreference/fieldtypes/BaseOptionsFieldType), namely Dropdown, Multiselect, Checkboxes, and RadioButtons. You could change your lightswitch to one of these other fieldtypes and have a default value available.


---

### Answer by username_1 on 2015-04-08. Score: 2

I just submitted a feature request to have an `entries.onBeforeEditEntry` event. This should make it possible to have default values for all sort of field types from a plugin.

[Raise an event before entry is edited/loaded in CP](http://feedback.buildwithcraft.com/forums/285221-feature-requests/suggestions/7494886-raise-an-event-before-entry-is-edited-loaded-in-cp)

> **Comments:**
> **username_2**: Apparently Brandon added a hook in response to your request. Does this now make it possible to set defaults? If so, could you perhaps expand your answer with a code sample?  

---

### Answer by username_3 on 2016-10-31. Score: 1

Here is a **[feature request to add a default value](https://craftcms.stackexchange.com/questions/10862/how-to-use-a-numeric-field-with-a-default-value)** to the native Number field type – voting for it will hopefully bring this functionality to Craft CMS.

(Also, Brad Bell [suggests another solution](https://craftcms.stackexchange.com/a/10863/37): Write a plugin that extends Craft's native Number field type.)


---

