A Simple postcode validation check on a Contact Form 7
2140
£15(approx. $19)
- Posted:
- Proposals: 14
- Remote
- #2034796
- Archived
⭐ ⭐ ⭐ ⭐ ⭐ Top Rated in Plymouth UK, 17+ Years Professional Experience, A+ Communications
Metuchen
WordPress, Magento, PHP, Android, IOS, Responsive Design, SEO, Software Testing
Ahmedabad
WordPress CMS Expert | API's & Integrations | Security | Themes, Plugins and Bespoke Functionality | PHP | HTML5 | JS | SQL | Full Stack
London
27426334462564236677573613000201390475141709715058831510416176439817724261839846
Description
Experience Level: Entry
Estimated project duration: 1 day or less
I need a simple tool that will validate if a postcode has been entered in the correct UK format. It doesn't need to be a checkup from any PAF etc, just a format validation.
It needs to be compatible with Contact Form 7 text or if it's made as a stand-alone WordPress form I can just add it to another page but would need a page redirect once the postcode has been entered and submitted.
I did find this on another website which shows the validation of postcodes I believe.
$.validator.addMethod( "postcodeUK", function( value, element ) {
return this.optional( element ) || /^((([A-PR-UWYZ][0-9])|([A-PR-UWYZ][0-9][0-9])|([A-PR-UWYZ][A-HK-Y][0-9])|([A-PR-UWYZ][A-HK-Y][0-9][0-9])|([A-PR-UWYZ][0-9][A-HJKSTUW])|([A-PR-UWYZ][A-HK-Y][0-9][ABEHMNPRVWXY]))\s?( [0-9][ABD-HJLNP-UW-Z]{2})|(GIR)\s?(0AA))$/i.test( value );
}, "Test" );
It needs to be compatible with Contact Form 7 text or if it's made as a stand-alone WordPress form I can just add it to another page but would need a page redirect once the postcode has been entered and submitted.
I did find this on another website which shows the validation of postcodes I believe.
$.validator.addMethod( "postcodeUK", function( value, element ) {
return this.optional( element ) || /^((([A-PR-UWYZ][0-9])|([A-PR-UWYZ][0-9][0-9])|([A-PR-UWYZ][A-HK-Y][0-9])|([A-PR-UWYZ][A-HK-Y][0-9][0-9])|([A-PR-UWYZ][0-9][A-HJKSTUW])|([A-PR-UWYZ][A-HK-Y][0-9][ABEHMNPRVWXY]))\s?( [0-9][ABD-HJLNP-UW-Z]{2})|(GIR)\s?(0AA))$/i.test( value );
}, "Test" );
Martin H.
100% (13)Projects Completed
7
Freelancers worked with
7
Projects awarded
33%
Last project
9 Feb 2020
United Kingdom
New Proposal
Login to your account and send a proposal now to get this project.
Log inClarification Board Ask a Question
-
Martin, please share your website link for quick review.
654547
We collect cookies to enable the proper functioning and security of our website, and to enhance your experience. By clicking on 'Accept All Cookies', you consent to the use of these cookies. You can change your 'Cookies Settings' at any time. For more information, please read ourCookie Policy
Cookie Settings
Accept All Cookies