• You MUST read the Babiato Rules before making your first post otherwise you may get permanent warning points or a permanent Ban.

    Our resources on Babiato Forum are CLEAN and SAFE. So you can use them for development and testing purposes. If your are on Windows and have an antivirus that alerts you about a possible infection: Know it's a false positive because all scripts are double checked by our experts. We advise you to add Babiato to trusted sites/sources or disable your antivirus momentarily while downloading a resource. "Enjoy your presence on Babiato"

Looking for gravity forms custom code

phukit

Well-known member
Trusted Uploader
Sep 30, 2018
345
661
93
Hi

Can anyone here help?

I am using gravity forms and using the predefined address fields/section.

there is no input mask for the zip/postal code and I am looking if someone can provide a snippet to achieve this.

Thanks!
 
After talking to the gravity forms team, it is not possible to add an input mask to the address fields.

This only applies to a single text field, that's why the code wasn't working.
 
I have finally developed a solution for input masking any form or input not just gravity forms.

Here is the solution if anyone is interested:

Code:
jQuery(document).ready(function(){

  jQuery('#INPUT_ID_GOES_HERE').mask('MASK_GOES_HERE');

});
 
Last edited:
  • Like
Reactions: 666
I have finally developed a solution for input masking any form or input not just gravity forms.

Here is the solution if anyone is interested:

Code:
jQuery(document).ready(function(){

  jQuery('#FORM_ID_GOES_HERE').mask('a9a - 9a9');

});
It's indeed in the description of how to use the jQuery MaskedInput plug-in that Gravity Forms uses, so it's very strange that they didn't suggest that as a solution.

As '.mask' is not part of core jQuery, it doesn't work for any form, you'll need a jQuery mask plug-in present or linked, such as the one above or the more recently updated jQuery Mask Plugin.
 
It's indeed in the description of how to use the jQuery MaskedInput plug-in that Gravity Forms uses, so it's very strange that they didn't suggest that as a solution.

As '.mask' is not part of core jQuery, it doesn't work for any form, you'll need a jQuery mask plug-in present or linked, such as the one above or the more recently updated jQuery Mask Plugin.

Thanks for the clarification.

I am surprised too that they never mentioned this because its an easy solution.

Thanks
 
AdBlock Detected

We get it, advertisements are annoying!

However in order to keep our huge array of resources free of charge we need to generate income from ads so to use the site you will need to turn off your adblocker.

If you'd like to have an ad free experience you can become a Babiato Lover by donating as little as $5 per month. Click on the Donate menu tab for more info.

I've Disabled AdBlock