Skip Navigation

[Resolved] How to remove 'No parent' option in cred-field?

This support ticket is created 7 years, 8 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

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

Supporter timezone: Europe/Madrid (GMT+02:00)

This topic contains 4 replies, has 3 voices.

Last updated by Mattnet 7 years, 8 months ago.

Assisted by: Juan.

Author
Posts
#425259
Screen Shot 2016-08-16 at 3.56.07 PM.png

I am trying to: show my list of possible parent to choose from

I visited this URL: hidden link

I expected to see: a list of just the options to choose, not a choice called 'No parent' that the user can actually choose

Instead, I got: 'No parent' as a choice....

I am looking to simply remove that option....I've tried adding the attribute

no_parent_text='false'

but it just shows 'false' as an option and same thing with no text at all (just leaves a blank option). I want to remove that option all together so that the first choosable option is the first of my cpt.

#425562

Hi There,

Thanks for contacting the Toolset support.

I have received your request about the 'no parents' option to remove.
I want to let you know that I am working on it.

You will hear back from me as soon as possible,

Thank you for your patience,

All the best,

Marine

#426031

Hi there,

Thanks for your patience, after investigate this case, I have to say that this feature is unfortunately not available in CRED yet, from the Toolset dashboard.

I am going to escalate your ticket to the Toolset development team leader, Juan.

He will be happy to get in touch with you about that and to provide you some efficient technical knowledge.

Meanwhile I have found a workaround for your request, you might be willing to explore this document, about a Jquery workaround:

http://stackoverflow.com/questions/1518216/jquery-remove-options-from-select

Hope that helped,

Marine

#426059

Juan
Supporter

Timezone: Europe/Madrid (GMT+02:00)

HI there

Thanks for the feedback.

I see that we have an usability issue here, together woth at least a request. I check ed how this parent field works on CRED forms, and noticed some things.

If the parent is not required, it is normal that you get an option to set nothing as a parent, because sometimes you might want to create say Pages, that do not have a parent. In this case, "required" seems to mean "an actual parent must be set".

So this is the first usability issue: instead of calling this required, we should label the option stating that selecting a parent is mandatory.

Now, there is also another option, available both when the parent field is required or now, that states "--- not set ---", and acts as a "Select one" value, since it holds an empty value. This is also needed, since without it, the first option would be the default selection when submitting the form.

But it introduces another usability issue. When the field is not required, we get this "--- not set ---" in addition to the "No Parent" option, shich is redundant ("No parent" should be the default and set no parent, of course). When the field is required, we get this "--- not set ---" option, as well as the "Select one" option, and both act as an empty value that will not pass the check for being required.

So, to sum up, we have two usability issues that, together, kind of form a usability request. First, we should better label whether a parent must be set or itmes without parent can be created, and second we should review the empty default values that we add, to avoid duplications.

We are about to release a new verson for all our plugins, so this is unfortunately too late for it. I will make sure we review this for the upcoming cycle.

Hope it helps.

Regards.

#426146

Thanks for the background on this. I look forward to fix in the next release (whichever one it lands in). The good thing is for functionality, adding the attribute

required='true'

to the form input like so

[cred_field field="_wpcf_belongs_x-collection_id" value="" required="true"]

does limit the choices to the real options in the list and doesn't allow submission of the form with '--- not set ---' or '--Please Select --' as the selection. And yes as you stated, there is a redundancy of having both those two unusable options in the list. Thanks!

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.