# \#gform\_field\_validation

**URL:** https://community.gravityforms.com/tag/gform-field-validation/64.md

[Latest](https://community.gravityforms.com/latest.md) · [Categories](https://community.gravityforms.com/categories.md) · [Tags](https://community.gravityforms.com/tags.md)

---

## [How to block links in text field? \[RESOLVED\]](https://community.gravityforms.com/t/how-to-block-links-in-text-field-resolved/5865)

<div class="topic-metadata">

**Author:** [@user5b199982d16560.5](https://community.gravityforms.com/u/user5b199982d16560.5)\
**Replies:** 7\
**Last updated:** [August 27, 2026, 7:25pm UTC](https://community.gravityforms.com/t/how-to-block-links-in-text-field-resolved/5865 "2026-08-27T19:25:50Z")

</div>

I’m trying to prevent people from entering URLs into a text field. I have this in my functions.php but it seems to break the form: function no\_url\_regex() { return '(http|https)'; } // add custom validation to form add…

---

## [How to Block Link Tags and URLs (HyperLinks) Contained in Any Form Field | Regex Format \[RESOLVED\]](https://community.gravityforms.com/t/how-to-block-link-tags-and-urls-hyperlinks-contained-in-any-form-field-regex-format-resolved/13787)

<div class="topic-metadata">

**Author:** [@AeroStar](https://community.gravityforms.com/u/AeroStar)\
**Replies:** 1\
**Last updated:** [August 27, 2026, 7:25pm UTC](https://community.gravityforms.com/t/how-to-block-link-tags-and-urls-hyperlinks-contained-in-any-form-field-regex-format-resolved/13787 "2026-08-27T19:25:04Z")

</div>

Good News! After thorough testing, the code snippet provided below accomplishes the following: Detects and blocks Link Tags contained in any form field. Detects and blocks URLs (hyperlinks) contained in any form field…

---

## [How to Block Links (URLs) in Text Area | Regex Format \[RESOLVED\]](https://community.gravityforms.com/t/how-to-block-links-urls-in-text-area-regex-format-resolved/13765)

<div class="topic-metadata">

**Author:** [@AeroStar](https://community.gravityforms.com/u/AeroStar)\
**Replies:** 2\
**Last updated:** [August 27, 2026, 7:24pm UTC](https://community.gravityforms.com/t/how-to-block-links-urls-in-text-area-regex-format-resolved/13765 "2026-08-27T19:24:28Z")

</div>

Good Day, We are using the code snippet provided here to block links (URLs) entered into our gravity forms text area. It works great, but does not block all possible URL patterns, so we’re using the following, modified…

---

## [Allowing www. in "website" field \[RESOLVED\]](https://community.gravityforms.com/t/allowing-www-in-website-field-resolved/20028)

<div class="topic-metadata">

**Author:** [@aiphelion](https://community.gravityforms.com/u/aiphelion)\
**Replies:** 2\
**Last updated:** [January 28, 2026, 1:35pm UTC](https://community.gravityforms.com/t/allowing-www-in-website-field-resolved/20028 "2026-01-28T13:35:27Z")

</div>

How can i allow users to enter their email address in a contact form as www.bbc.co.uk for example and not have it return the error indicating it doesn’rt start with https:// I think most people filling out the form woul…

---

## [Input mask for UK postcode \[RESOLVED\]](https://community.gravityforms.com/t/input-mask-for-uk-postcode-resolved/20004)

<div class="topic-metadata">

**Author:** [@emma.bumstead](https://community.gravityforms.com/u/emma.bumstead)\
**Replies:** 4\
**Last updated:** [January 22, 2026, 5:21pm UTC](https://community.gravityforms.com/t/input-mask-for-uk-postcode-resolved/20004 "2026-01-22T17:21:54Z")

</div>

I’m using a single line text field in Gravity forms with an input mask and need a custom mask for a UK postcode. Does anyone have a working example of a UK postcode input mask? Thanks

---

## [Blocking urls in name field](https://community.gravityforms.com/t/blocking-urls-in-name-field/19430)

<div class="topic-metadata">

**Author:** [@giraffeweb](https://community.gravityforms.com/u/giraffeweb)\
**Replies:** 4\
**Last updated:** [June 2, 2025, 10:45am UTC](https://community.gravityforms.com/t/blocking-urls-in-name-field/19430 "2025-06-02T10:45:06Z")

</div>

I can get the below to work to block urls in text or paragraph fields, but now spammers are putting the url in the name field. How do I add the name field to the below? If I add || $field-\>type == 'name' to the if state…

---

## [Does not contain logic](https://community.gravityforms.com/t/does-not-contain-logic/14932)

<div class="topic-metadata">

**Author:** [@user5a096b2969b522.0](https://community.gravityforms.com/u/user5a096b2969b522.0)\
**Replies:** 4\
**Last updated:** [May 1, 2025, 1:35am UTC](https://community.gravityforms.com/t/does-not-contain-logic/14932 "2025-05-01T01:35:10Z")

</div>

I can see that on page conditions, there is no option for ‘does not contain’ which I really need for my use case. I am trying to work around it by doing a custom validation on a postcode field instead This example look…

---

## [Validate email field in Gravity form \[RESOLVED\]](https://community.gravityforms.com/t/validate-email-field-in-gravity-form-resolved/12592)

<div class="topic-metadata">

**Author:** [@pedrorodriguez3265](https://community.gravityforms.com/u/pedrorodriguez3265)\
**Replies:** 2\
**Last updated:** [April 11, 2025, 7:06pm UTC](https://community.gravityforms.com/t/validate-email-field-in-gravity-form-resolved/12592 "2025-04-11T19:06:56Z")

</div>

Hello, I want to validate emails in gravity, not allowing users to go to the next step if the email is not valid. How can I do that, please, I also have gravity perk, any help would be welcome.

---

## [Blocking URL's in paragraph text fields](https://community.gravityforms.com/t/blocking-urls-in-paragraph-text-fields/18800)

<div class="topic-metadata">

**Author:** [@user5f07a64341de3865](https://community.gravityforms.com/u/user5f07a64341de3865)\
**Replies:** 5\
**Last updated:** [January 28, 2025, 4:08pm UTC](https://community.gravityforms.com/t/blocking-urls-in-paragraph-text-fields/18800 "2025-01-28T16:08:15Z")

</div>

Is the script in the topic below still the preferred method to block url entries in text fields and does it work with the latest version of gravity forms?

---

## [Email Validation Filter Does Not Work When Email Confirmation Enabled \[RESOLVED\]](https://community.gravityforms.com/t/email-validation-filter-does-not-work-when-email-confirmation-enabled-resolved/18750)

<div class="topic-metadata">

**Author:** [@AeroStar](https://community.gravityforms.com/u/AeroStar)\
**Replies:** 3\
**Last updated:** [January 16, 2025, 7:29pm UTC](https://community.gravityforms.com/t/email-validation-filter-does-not-work-when-email-confirmation-enabled-resolved/18750 "2025-01-16T19:29:33Z")

</div>

Hi there, Your filter, “Email validation by third-party API”, does not work when the Email form field option, “Enable Email Confirmation”, is enabled. When enabled, no matter what email address we enter in the email fi…

---

## [Gform\_field\_validation HELP!](https://community.gravityforms.com/t/gform-field-validation-help/18418)

<div class="topic-metadata">

**Author:** [@user5fd6623267946686](https://community.gravityforms.com/u/user5fd6623267946686)\
**Replies:** 0\
**Last updated:** [October 30, 2024, 5:13pm UTC](https://community.gravityforms.com/t/gform-field-validation-help/18418 "2024-10-30T17:13:20Z")

</div>

I have a grant application form with 2 number fields (“Grant 1 amount” and “Grant 2 amount”. There is also a “Total amount” field, which will dynamically display the sum of the “Grant 1” and “Grant 2 ,” fields. The sum t…

---

## [Postal Code Validation - Canada only](https://community.gravityforms.com/t/postal-code-validation-canada-only/18189)

<div class="topic-metadata">

**Author:** [@user5a21b0238cbd02.7](https://community.gravityforms.com/u/user5a21b0238cbd02.7)\
**Replies:** 2\
**Last updated:** [September 16, 2024, 3:07pm UTC](https://community.gravityforms.com/t/postal-code-validation-canada-only/18189 "2024-09-16T15:07:24Z")

</div>

Hi! I’m looking to validate a postal code field for Canadian postal codes. I see this post about validating a field here Zipcode validation for Gravity Forms (5 digits, 2 approaches). · GitHub , however this looks to be…

---

## [Email Validation legit addresses forms not processing](https://community.gravityforms.com/t/email-validation-legit-addresses-forms-not-processing/18197)

<div class="topic-metadata">

**Author:** [@CharityHub](https://community.gravityforms.com/u/CharityHub)\
**Replies:** 0\
**Last updated:** [September 13, 2024, 1:06am UTC](https://community.gravityforms.com/t/email-validation-legit-addresses-forms-not-processing/18197 "2024-09-13T01:06:35Z")

</div>

My website just started triggering this error when a form submission is being submitted // Check if score should be evaluated $emailScoreCheck = get\_option( 'email\_score\_check' ); $emailScore = floatval( get…

---

## [Field for code entry with verification of code entered](https://community.gravityforms.com/t/field-for-code-entry-with-verification-of-code-entered/18139)

<div class="topic-metadata">

**Author:** [@user5c06e1f2ef9338.7](https://community.gravityforms.com/u/user5c06e1f2ef9338.7)\
**Replies:** 4\
**Last updated:** [September 10, 2024, 9:51am UTC](https://community.gravityforms.com/t/field-for-code-entry-with-verification-of-code-entered/18139 "2024-09-10T09:51:21Z")

</div>

Hi. Using only the available options, e.g., conditional logic, would it be possible to verify a “static” code entered in an appropriate field? Let me explain: there will be 80 codes that will be made available; there wi…

---

## [How are these submissions getting past validation?](https://community.gravityforms.com/t/how-are-these-submissions-getting-past-validation/18087)

<div class="topic-metadata">

**Author:** [@user5ca4c7b283fb7673](https://community.gravityforms.com/u/user5ca4c7b283fb7673)\
**Replies:** 0\
**Last updated:** [August 28, 2024, 1:52pm UTC](https://community.gravityforms.com/t/how-are-these-submissions-getting-past-validation/18087 "2024-08-28T13:52:48Z")

</div>

Background: I have a form with a various required fields, one being a text field used to collect a zipcode and validate that it’s within an approved list of zips within our region. I’m using a the gform\_field\_validation …

---

## [Username validation not possible](https://community.gravityforms.com/t/username-validation-not-possible/17766)

<div class="topic-metadata">

**Author:** [@Shining824](https://community.gravityforms.com/u/Shining824)\
**Replies:** 1\
**Last updated:** [July 1, 2024, 3:02am UTC](https://community.gravityforms.com/t/username-validation-not-possible/17766 "2024-07-01T03:02:21Z")

</div>

Hi there, I try to prevent that new Users can use blanks in their username. (and btw I think its a bug that the addon can create users with that) It should be “JaneDoe” or “jane-doe” but NOT “Jane Doe” I already trie…

---

## [Stop Words for List fields](https://community.gravityforms.com/t/stop-words-for-list-fields/17387)

<div class="topic-metadata">

**Author:** [@user5d946cb97251d498](https://community.gravityforms.com/u/user5d946cb97251d498)\
**Replies:** 0\
**Last updated:** [May 1, 2024, 2:02pm UTC](https://community.gravityforms.com/t/stop-words-for-list-fields/17387 "2024-05-01T14:02:00Z")

</div>

Hello, wondering if I could have some advice please. Looking to prevent customers putting in words which aren’t answers. This is important are these are insurance quote forms, so can’t accept ‘unknown’ or just a question…

---

## [Conditional logic: compare field values to prevent spam](https://community.gravityforms.com/t/conditional-logic-compare-field-values-to-prevent-spam/17326)

<div class="topic-metadata">

**Author:** [@Andre\_B](https://community.gravityforms.com/u/Andre_B)\
**Replies:** 2\
**Last updated:** [April 26, 2024, 1:10pm UTC](https://community.gravityforms.com/t/conditional-logic-compare-field-values-to-prevent-spam/17326 "2024-04-26T13:10:11Z")

</div>

One of my sites apparently caught the attention of spammers. I have a contact form that gets used by them multiple times every day. I already use conditional logic to show/hide the submit button depending on the result …

---

## [Stop Links in All Forms - Functions](https://community.gravityforms.com/t/stop-links-in-all-forms-functions/16928)

<div class="topic-metadata">

**Author:** [@user5dcebf396db3d771](https://community.gravityforms.com/u/user5dcebf396db3d771)\
**Replies:** 4\
**Last updated:** [March 17, 2024, 11:04pm UTC](https://community.gravityforms.com/t/stop-links-in-all-forms-functions/16928 "2024-03-17T23:04:41Z")

</div>

I found some older posts on the subject and I was not able to come up with anything that works for me. I have a site with multiple forms. I tried using a few different snippets I found. Some of them just plain caused cri…

---

## [Verifying Addresses using either USPS, Google API, or Smarty Streets](https://community.gravityforms.com/t/verifying-addresses-using-either-usps-google-api-or-smarty-streets/16746)

<div class="topic-metadata">

**Author:** [@user654a972346170346](https://community.gravityforms.com/u/user654a972346170346)\
**Replies:** 2\
**Last updated:** [January 30, 2024, 9:50pm UTC](https://community.gravityforms.com/t/verifying-addresses-using-either-usps-google-api-or-smarty-streets/16746 "2024-01-30T21:50:58Z")

</div>

I’ve built a form that uses the default Gravity Forms Address block. I would like to verify addresses upon submission and validate street address, city, state, and zip for accuracy. I have looked all over for a plugin or…

---

## [If ZIP code in the list show one form. If no - show another \[RESOLVED\]](https://community.gravityforms.com/t/if-zip-code-in-the-list-show-one-form-if-no-show-another-resolved/16648)

<div class="topic-metadata">

**Author:** [@lana](https://community.gravityforms.com/u/lana)\
**Replies:** 2\
**Last updated:** [January 16, 2024, 11:41pm UTC](https://community.gravityforms.com/t/if-zip-code-in-the-list-show-one-form-if-no-show-another-resolved/16648 "2024-01-16T23:41:29Z")

</div>

Hello! My client wants to receive a form which when entering ZIP postcode (which is in the list) displays the order form. If there is no ZIP in the list, the contact form displays. Me finded that solution in the communi…

---

## [Check if Date Entered is a Sunday](https://community.gravityforms.com/t/check-if-date-entered-is-a-sunday/16436)

<div class="topic-metadata">

**Author:** [@bluespark](https://community.gravityforms.com/u/bluespark)\
**Replies:** 1\
**Last updated:** [December 15, 2023, 10:37pm UTC](https://community.gravityforms.com/t/check-if-date-entered-is-a-sunday/16436 "2023-12-15T22:37:56Z")

</div>

I have a form where I managed to change the date picker so that only sundays were selectable. That works OK, but people can still just enter any date manually, so what I was hoping to do was validate the entry somehow so…

---

## [How to ensure valid entry on forms \[RESOLVED\]](https://community.gravityforms.com/t/how-to-ensure-valid-entry-on-forms-resolved/16400)

<div class="topic-metadata">

**Author:** [@dapo](https://community.gravityforms.com/u/dapo)\
**Replies:** 3\
**Last updated:** [December 5, 2023, 8:09pm UTC](https://community.gravityforms.com/t/how-to-ensure-valid-entry-on-forms-resolved/16400 "2023-12-05T20:09:58Z")

</div>

Hi, I’m using Gravity forms on a client’s website. We noticed users can fill the form field with random information for example enter numbers or signs in the email fields, or text in the telephone field and the form sub…

---

## [Phone Validation - Any improvements that can be made?](https://community.gravityforms.com/t/phone-validation-any-improvements-that-can-be-made/16358)

<div class="topic-metadata">

**Author:** [@user5e4e0b0560a10293](https://community.gravityforms.com/u/user5e4e0b0560a10293)\
**Replies:** 1\
**Last updated:** [November 27, 2023, 2:41pm UTC](https://community.gravityforms.com/t/phone-validation-any-improvements-that-can-be-made/16358 "2023-11-27T14:41:35Z")

</div>

Hi, I’m sure plenty of you run into submissions from fake users / users that don’t want to give real details / users that make mistakes… I’ve worked on creating some some code using the gform\_validation hook to try and…

---

## [Users entering unnecessary '1' before area code in phone field](https://community.gravityforms.com/t/users-entering-unnecessary-1-before-area-code-in-phone-field/16263)

<div class="topic-metadata">

**Author:** [@jwebadgility](https://community.gravityforms.com/u/jwebadgility)\
**Replies:** 1\
**Last updated:** [November 13, 2023, 9:32pm UTC](https://community.gravityforms.com/t/users-entering-unnecessary-1-before-area-code-in-phone-field/16263 "2023-11-13T21:32:12Z")

</div>

We have a phone field on our form that is limited to 10 fields only. We are finding that some users are entering in the extra ‘1’ before the area code and thus we are not getting the last digit of their phone number. S…

---

## [Check divisibility of result \[RESOLVED\]](https://community.gravityforms.com/t/check-divisibility-of-result-resolved/15842)

<div class="topic-metadata">

**Author:** [@UBENU](https://community.gravityforms.com/u/UBENU)\
**Replies:** 2\
**Last updated:** [September 12, 2023, 9:01am UTC](https://community.gravityforms.com/t/check-divisibility-of-result-resolved/15842 "2023-09-12T09:01:06Z")

</div>

I created a small form with the fields num1 num2 num3 (set to 22) sum I would like to check if the sum can be divided by 4 and output a corresponding message. I know I can check a number with php and something like …

---

## [Using 1M or 1,000,000 in a form field](https://community.gravityforms.com/t/using-1m-or-1-000-000-in-a-form-field/15846)

<div class="topic-metadata">

**Author:** [@marco](https://community.gravityforms.com/u/marco)\
**Replies:** 1\
**Last updated:** [September 12, 2023, 4:30am UTC](https://community.gravityforms.com/t/using-1m-or-1-000-000-in-a-form-field/15846 "2023-09-12T04:30:02Z")

</div>

Hello - I have a form that collects prospective client information from our site and adds it to Salesforce via Zapier. The field name is “Value of Business” and defined Number / Currency. The challenge is how to handle…

---

## [Regex verification help](https://community.gravityforms.com/t/regex-verification-help/15834)

<div class="topic-metadata">

**Author:** [@hairyhobo](https://community.gravityforms.com/u/hairyhobo)\
**Replies:** 5\
**Last updated:** [September 7, 2023, 8:51pm UTC](https://community.gravityforms.com/t/regex-verification-help/15834 "2023-09-07T20:51:55Z")

</div>

Hello Just after some help with adding regex validation to fields. I have created some code with my formula and it works perfectly, what i wanted to know is… If i have a 2nd field on the same form, which will use the …

---

## [Regex verification](https://community.gravityforms.com/t/regex-verification/15544)

<div class="topic-metadata">

**Author:** [@hairyhobo](https://community.gravityforms.com/u/hairyhobo)\
**Replies:** 2\
**Last updated:** [July 19, 2023, 10:20am UTC](https://community.gravityforms.com/t/regex-verification/15544 "2023-07-19T10:20:35Z")

</div>

Hello I have been asked to add string baed verification to a form, which is pretty new to me so i am just looking for some advice. The validation would be +20.00 to -20.00, the + or - would be optional. I have the “r…

---

## [Age validation specific date \[RESOLVED\]](https://community.gravityforms.com/t/age-validation-specific-date-resolved/15545)

<div class="topic-metadata">

**Author:** [@user640a3df029020682](https://community.gravityforms.com/u/user640a3df029020682)\
**Replies:** 2\
**Last updated:** [July 19, 2023, 6:45am UTC](https://community.gravityforms.com/t/age-validation-specific-date-resolved/15545 "2023-07-19T06:45:01Z")

</div>

Hi all, We just started with Gravity Forms and I love how the community is interacting and writing solutions as an extension of the well-written docs. Now, we’ve just implemented a form with the age validation check wr…

[Next page](https://community.gravityforms.com/tag/gform-field-validation/64.md?match_all_tags=true&page=1&tags%5B%5D=gform_field_validation)
