diff --git a/f2/src/forms/LocationInfoForm.js b/f2/src/forms/LocationInfoForm.js index adb480283..0ce85149c 100644 --- a/f2/src/forms/LocationInfoForm.js +++ b/f2/src/forms/LocationInfoForm.js @@ -13,10 +13,12 @@ import { Link as ReactRouterLink } from 'react-router-dom' import { Flex, Icon } from '@chakra-ui/core' import { P } from '../components/paragraph' import { Button } from '../components/button' +import { Alert } from '../components/Messages' const defaultLocation = { postalCode: '', } +let postalValidation = true export const LocationInfoForm = props => { const [data, dispatch] = useStateValue() @@ -32,10 +34,27 @@ export const LocationInfoForm = props => { } } + function checkPostal(postal) { + var regex = new RegExp( + /^[ABCEGHJKLMNPRSTVXY]\d[ABCEGHJKLMNPRSTVWXYZ]( )?\d[ABCEGHJKLMNPRSTVWXYZ]\d$/i, + ) + if (regex.test(postal)) { + return true + } else { + return false + } + } + return (