2

I have a field of the dropdown fieldtype, let's call it myDropdown.

myDropdown has a list of options, one of which has the "default" checkbox checked.

If I use a front-end form to submit a new entry, but the form does not contain the myDropdown field, will Craft insert the value designated as the the default into that field, or will it just leave the field empty?

4

Yes, if you don't include the dropdown field in your entry form, Craft will store the default value for that field, if one has been set. If no default value has been set, then the value will be null.

  • I have some entries where that field is being left unpopulated, so I was just trying to figure out what the expected behavior should be. What you are describing is what I would expect, but I wanted to be sure the "default" setting wasn't just for determining which option got the "selected" property when dynamically creating form select elements. – Philip Jones Aug 10 '16 at 15:22
  • 2
    It's worth noting that any entries created before you created the dropdown field will have a null value until you actually assign a value to them, even if you set a default value. – Steve Rowling Aug 10 '16 at 15:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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