We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Conditionally required fields

Feature Requests

TJ Draper's avatar
TJ Draper
222 posts
10 years ago
TJ Draper's avatar TJ Draper

I often have a need to require one of two fields, or require another field only if another field is filled in. I don’t have any brainwaves on exactly how it would work, but I’d love to see a way to be able to do some sort of conditional requirements like this.

       
Kevin Cupp's avatar
Kevin Cupp
791 posts
10 years ago
Kevin Cupp's avatar Kevin Cupp

You should be able to do this if you’re using the Validation service. Here’s some docs on conditionally-required fields. And if you need more control, there’s Custom Conditional Rules.

       
TJ Draper's avatar
TJ Draper
222 posts
10 years ago
TJ Draper's avatar TJ Draper

I’m not sure if we’re talking about the same thing or not. I mean all fieldtypes for an entry in general. I’m talking higher level than validating fields in my own custom field type. I mean as I’m laying out channel entires as a general developer in ExpressionEngine and designing the content structure. There may be some fields that I need to require along with others, and some fields I don’t want to require if another field is filled in.

       
Kevin Cupp's avatar
Kevin Cupp
791 posts
10 years ago
Kevin Cupp's avatar Kevin Cupp

Ahh sorry, I thought you meant form inputs in general. Well the underlying code for the actual validation is there, sounds like we just need a UI to hook up rules for channel fields. Thanks for the suggestion!

       
Derek Jones's avatar
Derek Jones
7,561 posts
10 years ago
Derek Jones's avatar Derek Jones

Funnily enough, I just today re-read the Note I created for myself when you mentioned something similar at #eeconf in October.

       
TJ Draper's avatar
TJ Draper
222 posts
10 years ago
TJ Draper's avatar TJ Draper

Did I mention this at eeconf? It’s like I think the same thoughts all the time. At least I’m consistent. 😊

       
Derek Jones's avatar
Derek Jones
7,561 posts
10 years ago
Derek Jones's avatar Derek Jones

I think so? When we were talking about making field requirement a per channel setting. If not, my mind went there. 😊

       
TJ Draper's avatar
TJ Draper
222 posts
10 years ago
TJ Draper's avatar TJ Draper

Oh, I probably did mention it, I just didn’t have the hard drive space to store that particular bit apparently. I’ve wished it could be done before. It came up again today and I thought why not post it where it can get some attention.

I do remember discussing that when fieldtypes are decoupled from field groups whether they are required or not would need to be a setting when adding them to a channel, and not always for that field. So my mind is not completely gone. 🐛

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.