Skip Navigation

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

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 4 replies, has 2 voices.

Last updated by Minesh 1 year, 2 months ago.

Assisted by: Minesh.

Author
Posts
#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.
hidden link

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.

hidden link

#2642163

Minesh
Supporter

Languages: English (English )

Timezone: 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

Languages: English (English )

Timezone: 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?
=> hidden link

#2642203

Working: hidden link

Not working: hidden link

#2642205

Minesh
Supporter

Languages: English (English )

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

Can you please check now: hidden link

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!