Hi,
It looks like there is a bug in the contact form builder (or perhaps I missed something?).
When choosing “is a valid number”, leaving the field empty seems to be considered as valid (please see the last field in my link: when trying to submit the empty form, the last field is green).
Thanks in advance !
Hi MrNayals!
Tbh I’m not sure if this is really a bug or an intended behavior. I’ll report it to Kriesi though. For a quick fix open up wp-content/themes/enfold/js/shortcodes.js and replace:
if(!value.match(/^(\d)*$/))
with
if(!($.isNumeric(value)))
Cheers!
Peter
Hi Peter,
Thanks for your quick response.
If it is an intended behavior, it is definitely inconsistent with the rest of the validity checks. Maybe there should be an option in the contact form builder to choose if the input can be empty separately from the input format?
As for the fix, I did what you suggested, but it keeps turning green when it’s empty. Any other idea?
Hi!
Strange, try this code instead:
if(!($.isNumeric(value)) || value == "")
Regards,
Peter
I’m afraid none of them work: still green when empty.
Hey!
I corrected the code: https://kriesi.at/support/topic/contact-form-bug-with-is-a-valid-number/#post-297816 – please try it again.
Cheers!
Peter
Still not working :(
Tricky one, huh ?
Hey!
Please try to clear the browser cache – I tested it on my server: http://test.inoplugs.com/agb-2/ and it works just fine.
Best regards,
Peter
It works !!! Thanks a lot :)
And just out of curiosity, have you heard back from Kriesi on this subject ? Is it a bug ?