Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #296783

    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 !

    #297342

    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

    #297721

    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?

    #297816

    Hi!

    Strange, try this code instead:

    
    if(!($.isNumeric(value)) || value == "")
    

    Regards,
    Peter

    #297857

    I’m afraid none of them work: still green when empty.

    #298878

    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

    #298923

    Still not working :(
    Tricky one, huh ?

    #299102

    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

    #299133

    It works !!! Thanks a lot :)

    And just out of curiosity, have you heard back from Kriesi on this subject ? Is it a bug ?

    #299320

    Hi!
    Yes it is. we will add the fix to the next theme update ;)
    Best regards,
    Kriesi

Viewing 10 posts - 1 through 10 (of 10 total)
  • The topic ‘Contact form: bug with "is a valid number"’ is closed to new replies.