Skip Navigation

[Resolved] Post title is not required when used inside a conditional group

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

Problem:
Post title is not required when used inside a conditional group

Solution:
You can make the title required on the browser side by adding the Javascript code:

You can find the proposed solution in this case with the following reply:
=> https://toolset.com/forums/topic/post-title-is-not-required-when-used-inside-a-conditional-group/#post-1868643

Relevant Documentation:

This support ticket is created 4 years, 1 month 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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 7 replies, has 3 voices.

Last updated by Jane 4 years, 1 month ago.

Assisted by: Minesh.

Author
Posts
#1868621

There should be 3 fields that are required on the test form (select post title, select relationship and page title)
If you satisfy the first two and forget to put a value for the page title, then submit the post. You will get a post with no title.
On that form you will see two title fields in different conditions. My workaround on test form BF , I moved the title field out of the condition and left the label in the condition. I was only looking for a different description on what to be put in the field but I still wanted the title field to be required.

#1868643

As a workaround for this issue, we can make the title required on the browser using JS code. For example:

jQuery(function($){
  $('input[name="post_title"]').attr('required', 'true')
})

I am checking this issue with our 2nd Tier to confirm if this is a bug or if we should not use the post title inside conditional groups. I'll get back to you as soon as possible.

#1870233

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Jamal is off. This is Minesh here and I'll take care of this ticket. Hope this is OK.

We checked with our 2nd tier and you are welcome to use the workaround for now and there is need to escalate this issue to our next level support. Please feel free to mark resolve this ticket.

Have a great day!!

#1871739

Expanding on this issue...

Will all other field types if set as required and put under a condition , still remain as a required field ?

#1871847

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

I wonder why you want to add required fields under conditions as required fields are required and always be visible.

Or you have some different case?

You should check and let me know how it goes and explain your case.

#1871991

MINESH,

Since you are coming into this topic late, you do not understand the concept or issue. NO required fields are not always visible. If they are put in conditions they are hidden, until a condition is met for them to be visible. My question is when there condition is met, will they still be a required field as that was not the case with post title. I was only asking since there was a problem with post title becoming a non required field when put in a condition, could this happen with any other field types loosing there required status if they are put in a condition.

#1872767

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Could you please tell me what conditions you added. You added condition based on custom field or taxonomy?

If you can share those details I will run a test with my test site and then guide you in the right direction.

#1875433

Thank you for your help Jamal.