Skip Navigation

[Resolved] For the user it makes it look like they have to fill the dates out again.

This thread is resolved. Here is a description of the problem and solution.

Problem:

One strange thing though when you click submit and the page refreshes and show the error message. The date fields that have been filled out, go blank as if they are empty, but still submits the dates when you click submit.

Solution:

It is possible to add a JS validation for the custom checkboxes, so it will be able to avoid the problem you mentioned above, for example:

https://toolset.com/forums/topic/for-the-user-it-makes-it-look-like-they-have-to-fill-the-dates-out-again/#post-1376091

Relevant Documentation:

This support ticket is created 5 years, 1 month ago. 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/Hong_Kong (GMT+08:00)

Tagged: 

This topic contains 4 replies, has 2 voices.

Last updated by leilaG 5 years ago.

Assisted by: Luo Yang.

Author
Posts
#1371193

Great thanks, it's working now.

One strange thing though when you click submit and the page refreshes and show the error message. The date fields that have been filled out, go blank as if they are empty, but still submits the dates when you click submit.

For the user it makes it look like they have to fill the dates out again.

Could you have a look to see if that is normal behavior.

Thanks

#1371201

Hello,

No, it is not normal behavior, the problem is abnormal, please check these:
1) In case it is a compatibility problem, please deactivate all other plugins, and switch to wordpress default theme 2019, 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 form URL, I need to test and debug it in my localhost, thanks
https://toolset.com/faq/provide-supporters-copy-site/

#1375383

Hi Luo, we had to disable the required field, because the field was a conditional field, (Only shows if user profile location field is 'Nottingham')

The error message was showing for all locations where the field was not visible so the users could not submit the form.

Is there any solution for this?

We will do some trouble shooting as you suggested regarding the blank calendar.
Thanks

#1376091

For the original question of this thread:

The date fields that have been filled out, go blank as if they are empty, but still submits the dates when you click submit.

I have tried the credentials you provided in previous thread:
https://toolset.com/forums/topic/validation-option-missing-from-checkbox-field/#post-1367173
The credentials is not valid, I get below errors:

ERROR: the password you entered for the username developer is incorrect.

Please check it.

I think it is possible to add a JS validation for the custom checkboxes, so it will be able to avoid the problem you mentioned above, for example: Edit the post form, click "JS Editor", add below JS codes:

jQuery(document).on('cred_form_ready', function() {
     
  jQuery('[name="wpcf-building-access-required[]"]').addClass('js-wpt-validate');
   
  jQuery.validator.addClassRules("js-wpt-validate", {
    required: true,
   });
   
});
#1378035

Thank you for the code, we will try it out 🙂