Skip Navigation

[Resolved] Number validation not working if conditional display is set on another field

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

Problem:

Field validation does not work in Block editor.

Solution:

This is fixed in the latest version of Toolset Types plugin.

Relevant Documentation:

This support ticket is created 4 years, 6 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
- 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)

This topic contains 6 replies, has 2 voices.

Last updated by lindsayH 4 years, 4 months ago.

Assisted by: Luo Yang.

Author
Posts
#1621545
With Condition - will save non numerical.png
Condition Set.png
Without Condition.png

The number field's slug is total-years. If I set a condition on the following field then I can save a post without any message\error appearing - total-years is a number field and should error if I type in five (for example). The condition on the field quote-identity is: empty($(total-years))
So if Total Years = nothing, don't show the Select field (quote-identity)

The condition itself works as expected, i.e. if something entered in Total Years, then Quote Identity disappears from the screen, but then the validation doesn't work as noted above.
If I remove the condition, the validation works.

#1622515

Hello,

Are you using Blocks editor to create/edit the post?

I have tried it in my localhost with the setting you mentioned above, after fill value "FIVE" into "Total Years" field, save the post, refresh browser, I see the field "total-years" is empty, can you confirm it?

#1622941

Yes. Blocks Editor.

If a previously saved post and I enter in a word like Five, and refresh, it reverts back to the originally saved number (5).

If it's brand new and I refresh, yes it goes back to being empty.

Hope that helps. Lins

#1623873

Thanks for the confirmation, I have escalated this issue, will update here if there is any news.

#1657747

Here is the feedback from our developers, this is fixed in next version of Types plugin 3.1.11, which is under QA status, but I am not sure when will it be released.

#1669167

Toolset Types plugin 3.3.11, you can download it here:
https://toolset.com/account/downloads/
please test it, check if the problem is fixed, thanks

#1677233

My issue is resolved now. Thank you!