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 Answer 1

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.

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

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.