Jump to content

Can database fields be 'required' based on a category?


Kevin W
 Share

Recommended Posts

I'm working on a new IPS install (so bear with me) and am working on setting up a new DB.  The DB will be a directory of places.  Some of the places are public retail spots and others are private (by invite only) but the listing of the location will be viewable by all.  I've created two categories, "Public" & "Private".

When creating a new field such as an Address, is it possible to require the address if the location is in the Public category but optional if it is in the Private category?

Link to comment
Share on other sites

5 minutes ago, opentype said:

Not directly, but a simple work-around would be to use two address fields. You can then activate the required one for the Public category and the optional one for the Private category. The user wouldn’t even notice it is handled this way. 

Thanks :)  Would it be safe for me to assume then that for it to work that way that I'd need to use a custom input form for the DB?

Link to comment
Share on other sites

1 hour ago, opentype said:

No. The fields can be turned on and off on the category level in the category settings. That way, the form will automatically include the right fields when entries are added into a category. 

Oooooh, I see now.  I thought I came across 'define fields per category' at one point but taking another look now I see it clearly; by default the category defaults to having 'all' fields selected on the 'form fields' tab but I can turn off 'all' and individually select which fields are associated to the form per category.

 

Thanks, kindly, that opens up new possibilities for what I'm working on.  :cool:

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...