Classic Form/Phone Field: Backslashes are added to mask if the field is conditionally shown.

  • formmobly
    Asked on December 11, 2018 at 8:16 AM

    Hi,

    I noticed a masked telephone input with the rule +55 (##) 9####-#### is inserting weird backslashes (maybe because of improper character escaping in your code) whenever I hide and unhide the field. This value is not fixed upon submission, meaning the backslashes will 'leak' to my reports and database.

    It starts looking like this:

    And after hiding and unhiding it, like, 4 times, it looks like this:

    I also noticed some backslashes will mysteriously vanish on mouse hover / focus, while some will persist. Checking the submission on my dashboard, backslashes are still there:

    I guess it's probably the 9 who's causing all this ruckus, so I'll remove it for now. Please let me know once you fix this.

    Thanks in advance,

    Dan.

  • Richie JotForm Support
    Replied on December 11, 2018 at 12:31 PM

    I have tested a cloned version of your form and I can't seem to replicate the issue at my end.

    I have added the 9 in the Mask sequence and the data returned is without the backslashes.

    Sample Screenshot:

    Classic Form/Phone Field: Backslashes are added to mask if the field is conditionally shown Screenshot 20


    May we know if you form is embedded to a web page?

    I have cleared your form cache. Kindly try to test your form again and let us know if the issue still remains.

  • formmobly
    Replied on December 11, 2018 at 1:23 PM

    Hey there,

    Nope. Not embedded. And the issue still remains. For some reason I pasted the screenshots here, but they weren't posted.

    I must stress that this happens when I hide / unhide the field by means of form conditions (when I tick a checkbox that hides it, for example).

    Would you like me to try and make a GIF so you can see what's happening? Maybe you're just not visualizing what I'm trying to convey.

    Anyways, it's not such a pain not to have the 9 in the mask, I just thought I should report the bug.

    Dan.

  • Richie JotForm Support
    Replied on December 11, 2018 at 2:35 PM

    Thank you for the added information. I checked the cloned form again and this time I was able to replicate the issue.

    Here is my sample screen cast:

    Classic Form/Phone Field: Backslashes are added to mask if the field is conditionally shown Screenshot 30

    To fix this issue, can you please change your "Clear Hidden Field Values" to Don't Clear or Clear on submit.

    Go to your settings>form settings>scroll down until you find Clear Hidden Field Values.

    Classic Form/Phone Field: Backslashes are added to mask if the field is conditionally shown Screenshot 41

    Please give it a try and let us know if the issue still remains.

  • formmobly
    Replied on December 11, 2018 at 3:30 PM

    Hmm. I see! Thanks.

    I can't really let go of the "clear on hidden" feature, because I need it in order for the conditions to work properly - some conditions are triggered if the field has a value.

    For now I'm gonna stick with stripping the validation of its 9. It's really less harmful than having the fields not cleared up.

    I can make do the way it is, but your devs should totally look into it, I think.

    Thanks, anyways!

    Dan.

  • Kevin Support Team Lead
    Replied on December 11, 2018 at 6:13 PM

    I will forward the issue to our second level so our developers can have a look on this, I have been testing and noticed the issue happens only when the mask has a 9 and only with the first in the string. 

    We will keep you updated via this thread. 


  • NeilVicente
    Replied on December 14, 2018 at 1:42 AM

    Hello Dan,

    This issue has been rectified.

    You may now use the number 9 on your masks without a problem.

    Kind regards,

  • formmobly
    Replied on January 15, 2019 at 6:54 AM

    Neat! Tested it and it's all tidy, now. Great job!

    Dan.