Skip Navigation

[Résolu] Validation on multiselect generic fields – error not on field.

This support ticket is created Il y a 4 années 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.

Aucun de nos assistants n'est disponible aujourd'hui sur le forum Jeu d'outils. Veuillez créer un ticket, et nous nous le traiterons dès notre prochaine connexion. Merci de votre compréhension.

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/Hong_Kong (GMT+08:00)

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

Dernière mise à jour par stuart Il y a 4 années et 10 mois.

Assisté par: Luo Yang.

Auteur
Publications
#1454407

validation on multiselect generic fields is not working, its not displaying the error message above the field.

It is working if you use other field types, eg.: select.

its showing the message in the error message box as normal, however not on the field.

Ive have tried using the cred validate filter and the option on the field for required, both dont seem to show error above field.

e.g this works, I get an error when the field is empty.

  [cred_generic_field type='select' field='test']
{
"required":1,
"default":[],
"options":[{"value":"one","label":"otne"},{"value":"two","label":"two"}]
}
[/cred_generic_field]

e.g doesn't generate and error above the field when the field is empty.

  [cred_generic_field type='multiselect' field='test'] 
{
"required":1,
"default":[],
"options":[{"value":"one","label":"otne"},{"value":"two","label":"two"}]
}
[/cred_generic_field]

If there is an issue with the way this validation works for multiselct, be cool to know if there is any workaround to getting the field highlghted so the user knows which are the issue fields...

Ill keep looking for a solution and will close this if I find one, but Ive been looking for a while ... hence the ticket 🙂

thanks guys

#1455529
multple-select-error.JPG

Hello,

I have tried the same shortcode as you mentioned above in my localhost with a fresh WordPress installation + the latest version of Toolset plugins, it works fine, I can see the error message: This field is required

See screenshot: multple-select-error.JPG

So the problem you mentioned above is abnormal, please check these in your website:
1) In case it is a compatibility problem, please deactivate all other plugins, and switch to wordpress default theme 2020, deactivate all custom PHP/JS code snippets, and test again

2) Also check if there is any PHP/JS error in your website:
https://toolset.com/documentation/programmer-reference/debugging-sites-built-with-toolset/

3) If the problem still persists, please provide database dump file(ZIP file) of your website, also point out the problem page URL and view URL, I need to test and debug it in my localhost, thanks
https://toolset.com/faq/provide-supporters-copy-site/

#1458805

I've identified that for some reason this SEO plugin in causing it: All in One SEO

lien caché

No idea why it would cause this to only fail to show the message on a multi select field and nothing else in CRED forms?

most bizarre ...

when the plugin is disabled the message will show to say its mandatory (above the field), however if there is also a filter function on the field this message will not show in the error box.

When the plugin is enabled, it will not show the message above the field but it will show a message in the error box when a filter function is enabled.

I do need to use the plugin so I will have to find an alternative to show that the fields are required, some kind of highlight on them maybe?

#1458963

Since it is a compatibility issue, please provide a full copy of your website, also point out the problem page URL and form URL, I need to duplicate the same problem in my localhost, thanks
https://toolset.com/faq/provide-supporters-copy-site/

#1461175
error5.JPG

Thanks for the details, here are what I found in your duplicator package, please correct me if there is anything missing:
1) Login website
2) Activate plugin "All In One SEO Pack"
3) Test problem page in front-end:
lien caché

4) click button "Submit"

I can see the error message, see the screenshot error5.JPG

So there might be other compatibility/server problem in your website, did you get any PHP debug logs?
If you need assistance to locate the problem, please provide a test site with the same problem, fill below private message box with the test site's credentials and FTP access.

#1468461

I will close this for now as its probably a weird issue, and I can explicitly disable the plugin causing the issue on the pages with forms if necessary... so its a quick fix.

Cheers