0

In a custom extension, can I make a settings field required to have a value without having a create a custom form using settings_form()?

1

Not really, no. You could force front-end validation by crafting an Accessory and making those fields have a "required" attribute, but you're best bet is to just use the settings_form() functionality. It's not hard, just follow the guide!

https://ellislab.com/expressionengine/user-guide/development/extensions.html#built-in-settings-form-and-processing

As an alternative to making fields "required", you could only set settings that are radio fields or select fields, and have defaults. It's really not the same, but I'm not sure what you're requirements are.

| improve this answer | |
  • Thanks, I have quite a few values so didn't really want to go through the process of creating a form. – wot Sep 23 '15 at 16:29

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.