Skip Navigation

[Resolved] Warning message missing , its hidden

This support ticket is created 6 years, 3 months 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
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 9 replies, has 2 voices.

Last updated by Nigel 6 years, 3 months ago.

Assisted by: Nigel.

Author
Posts
#1082786

Hi ,

wonder why my form is not displaying the validation messages ? in the source code its hidden.

pls advice. thanks.

<small for="cred_user_form_6590_1-textfield-1-1534228501" generated="true" class="wpt-form-error" style="display: none;">This field is required</small>

#1082816

from here:https://toolset.com/forums/topic/custom-validation-error-message-does-not-show/

i read that validation message is for backend only ?
for front end need to include js code ?

#1082821

i am trying to find some api here:
https://toolset.com/documentation/programmer-reference/cred-api/#cred_form_validate
but nothing on wpt [userefields ?] , only wpcf custom fields .?

#1082830

update : i read from here , one of the method to solve this is DONT use general field but use custom types field.?
https://toolset.com/forums/topic/cred-how-to-make-fields-required/page/2/#post-259662

is this still valid and possible solutions to create field specific validation message ?

#1082908

wow. its been 4+ hrs no one picking the tab ??

#1082958

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi there

We answer tickets in the order they are submitted and get to them as quickly as we can, sorry you had to wait.

You have a Types field which is set to required, and this field is included in a Toolset Form to publish posts, and if a user tries to submit the post without completing the field, that message is added to the DOM (by the Form JavaScript validation), but is not visible because it has a display:none inline style attribute added. Is that correct?

I'm testing the same on a vanilla site and it works as expected, the message is added to the DOM and I can see it (no inline style is added).

So what you are seeing is unexpected, and may be coming from some custom code or a conflict with another plugin or the theme.

Can you please re-test with the twentyseventeen theme and all non-Toolset plugins de-activated.

Is the inline display:none style still added?

#1082967

Hi

the form is here: hidden link

could you check , i adjusted with css, cause there were no class for .wpt-form-error and wpt-form-success, is that normal ?

thanks

#1083057

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Screen Shot 2018-08-14 at 16.03.44.png

Sorry, you are talking about a user form, not a post form.

I was describing (and testing) a post form above.

On a user form if you auto-generate the markup it will add a placeholder for error messages that are generated by server-side validation, and it will initially have the inline style of display:none, but which will be removed (i.e. the error message will be made visible) if server-side validation errors are thrown.

In my screenshot you can see that the top error was shown when I tried to register a user with an existing username.

There is some JavaScript front-end validation on such forms, where, if you enter non-matching passwords or an invalid email address, an inline error message is shown next to the field before you try to submit the form.

From your messages above I'm not sure what the problem is, i.e. what you are expecting that is different from the default behaviour.

#1083063

Thanks for the explanations, i just want to confirm the behaviour is right,

so its hidden first, then appear as form validations, could you confirm there is no toolset css on web-form-error etc ?
we have to manually design it ?

#1083066

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Screen Shot 2018-08-14 at 16.20.47.png

Inspecting the page source it looks like that hidden div is never actually displayed, another div is inserted containing the actual error, and it has very basic styles for .wpt-form-error with most of the styling being added with the Bootstrap classes of .alert and .alert-danger.

Try inspecting the source code when an error has been generated and it should be clear.