Passer la navigation

[Résolu] CRED post form drop down of taxonomy – default to Select instead of values

This support ticket is created Il y a 1 année et 10 mois. 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 -

Fuseau horaire du supporter : Asia/Kolkata (GMT+05:30)

Ce sujet contient 4 réponses, a 2 voix.

Dernière mise à jour par Minesh Il y a 1 année et 10 mois.

Assisté par: Minesh.

Auteur
Publications
#2642137
Screenshot 2023-09-08 at 7.49.40 AM.jpg
Screenshot 2023-09-08 at 7.49.51 AM.jpg

I have two CRED post forms using similar fields. For the Create Artist Profile form, the drop down defaults to "- Select -" and works as expected. (You have to be logged in to see this form.
lien caché

For the Create Organization Profile form, the drop down defaults to the first value in the taxonomy. I've copied the same field data and am using the same taxonomy (shared by both post types), so I can't understand why it doesn't default to " - Select - " as well.

lien caché

#2642163

Minesh
Supporter

Les langues: Anglais (English )

Fuseau horaire: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Can you please check with your form in edit form for the form where select option works. There must be custom JS added to add select option for your taxonomy, you should add the same to your another form.

If you do not get please send me admin access details and I would be happy to check the issue further.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I have set the next reply to private which means only you and I have access to it.

#2642201

Minesh
Supporter

Les langues: Anglais (English )

Fuseau horaire: Asia/Kolkata (GMT+05:30)

Can you please share where on what page on the frontend I can see the following form that is working in action?
=> lien caché

#2642203

Working: lien caché

Not working: lien caché

#2642205

Minesh
Supporter

Les langues: Anglais (English )

Fuseau horaire: Asia/Kolkata (GMT+05:30)

Can you please check now: lien caché

To your form's JS box I've added the following custom JS code:

jQuery(document).ready(function($) {
    jQuery("select[name='iowa-county[]']").prepend('<option value="">- Select -</option>');
    jQuery("select[name='iowa-county[]']")[0].selectedIndex = 0;
    jQuery("select[name='iowa-county[]']").attr("required","");
});
#2642209

Thank you! It appears to be working now!