Saltar navegación

[Resuelto] CRED post form drop down of taxonomy – default to Select instead of values

This support ticket is created hace 1 año, 3 meses. 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)

Este tema contiene 4 respuestas, tiene 2 mensajes.

Última actualización por Minesh hace 1 año, 3 meses.

Asistido por: Minesh.

Autor
Mensajes
#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.
enlace oculto

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.

enlace oculto

#2642163

Minesh
Supporter

Idiomas: Inglés (English )

Zona horaria: 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

Idiomas: Inglés (English )

Zona horaria: 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?
=> enlace oculto

#2642203

Working: enlace oculto

Not working: enlace oculto

#2642205

Minesh
Supporter

Idiomas: Inglés (English )

Zona horaria: Asia/Kolkata (GMT+05:30)

Can you please check now: enlace oculto

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!