Skip Navigation

[Resolved] Is there a way to mke a many-to-any relationship field required?

This thread is resolved. Here is a description of the problem and solution.

Problem:

The issue here is that the user wanted to make the relationship field Mandatory, so when a user is creating a post they have to connect it to another post in a relationship.

Solution:
Unfortunately this is not possible to do unless some form of custom code is used to check to see if the post is being submitted with the relationship field filled.

This support ticket is created 3 years, 10 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

Tagged: 

This topic contains 4 replies, has 2 voices.

Last updated by wimD-2 3 years, 10 months ago.

Assisted by: Shane.

Author
Posts
#1937911

Tell us what you are trying to do? My site uses many-to-many relationships to connect related content. I would like to make some of these relationships required. When new content is added and these fields are not filled in due to forgetfulness, the site doens't work as intended.

What is the link to your site? The site is under development at hidden link

#1938441

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Wim,

Thank you for getting in touch.

You can do this by going to your Relationship and scrolling to the Intermediary Post Type and custom fields section and click the Edit Fields button.

From there you will be taken to the page where all your custom fields are added.

Edit each of your fields on this screen and there should be a required checkbox next to validation.

Please let me know if you're seeing this.

Thanks,
Shane

#1938605
Screenshot 2021-02-08 210736.jpg

Hi Shane

I think we're talking about something different. I have content type called Route and one called Bezienswaardigheid (heritage). I have created a many to many relationship so I can display which heratage is to be seen on which walking route and vice versa. When I make or edit a Route or Heratage, I have the relationship field there, but I want this relationship field to be required (see screenshot).

Thanks,
Wim

#1938625

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Wim,

I believe i understand a bit better with the screenshot now. You want to make connecting a post to a relationship required, not a custom field that is in the relationship.

Unfortunately no we don't have a way to make the relationship required.

Thanks,
Shane

#1938657

Too bad! Thank you!