Skip Navigation

[Gelöst] Split: the select2 does not always work

This support ticket is created vor 4 Jahren, 3 Monaten. 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
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9: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/Karachi (GMT+05:00)

Author
Artikel
#1763417

BTW - the select2 does not always work, is there something I'm doing wrong?

Thanks!

#1763421

Hi,

Can you please share some details about exactly on which page and for which field you're facing this?

I'll be in a better position to look into this accordingly.

regards,
Waqar

#1763957

I should have done that, sorry. Do you mind adding a private field please? Thanks

#1764161

Hi,

I'm setting your next reply as private so that you can share the details about the issue.

You don't have to share the admin access details, as I've got it from our chat today.

regards,
Waqar

#1764171

/add-camera-issue/ (camera location) (BTW - field values missing from 'camera title' related to the function issue I think :))
--form ?post=7451&action=edit
/create-schedule/ (user id)
--form ?post=12504&action=edit
/record-absence/ (officer)
--form ?post=8755&action=edit
/track-time/ (vehicle location)
--form ?post=2267&action=edit

Thanks

#1765035

Thank you for sharing these details.

1. Form "Report Camera Issue" ( page: Add Camera Issue )

The code used for the applying select2 script in the form is:


jQuery(document).ready(function() {
    jQuery('select[name="wpcf-tmna-location-title"]').toolset_select2();
    jQuery('select[name="wpcf-camera-title"]').toolset_select2();
});

But the slug of the field for the "Camera Location" is "wpcf-vehicle-location" and not "wpcf-tmna-location-title", and so it should be:


jQuery(document).ready(function() {
    jQuery('select[name="wpcf-vehicle-location"]').toolset_select2();
    jQuery('select[name="wpcf-camera-title"]').toolset_select2();
});

2. Form "Schedule Builder" ( page: Create Schedule ) & Form "Record Absence" ( page: Absence Entry Form )

Both these forms have the same issue that no custom script is included to apply select2 to fields "user id" and "Officer".

The slug of both these fields is the same "wpcf-user-id" so, in both forms, you'll need to include the following code in the"JS editor":


jQuery(document).ready(function() {
    jQuery('select[name="wpcf-user-id"]').toolset_select2();
});

3. Form "Add Time" ( page: Track Time )

The code used for the applying select2 script in the form is:


jQuery(document).ready(function() {
    jQuery('select[name="wpcf-tmna-location-title"]').toolset_select2();
});

But the slug of the field for the "Vehicle Location" field is "wpcf-vehicle-location" and not "wpcf-tmna-location-title", and so it should be:


jQuery(document).ready(function() {
    jQuery('select[name="wpcf-vehicle-location"]').toolset_select2();
});

#1767195

My issue is resolved now. Thank you!