diff --git a/pwa/src/components/PatientInfoForm.tsx b/pwa/src/components/PatientInfoForm.tsx index 30da2e1..72088c5 100644 --- a/pwa/src/components/PatientInfoForm.tsx +++ b/pwa/src/components/PatientInfoForm.tsx @@ -19,6 +19,7 @@ export default function Form(): ReactElement { const [visit, setVisit] = useState(0); // Default: No const [pregnant, setPregnant] = useState(0); // Default: No const [planning, setPlanning] = useState(0); // Default: No + const [bloodPressureValue, setbloodPressureValue] = useState(""); // Data for Radio Buttons const sexValues = [ @@ -73,6 +74,13 @@ export default function Form(): ReactElement { } }; + const validateBp = (value: string) => { + const newChar = value.slice(-1); + if (newChar.match(/[0-9]|\/|^$/) && value.length < 8) { + setbloodPressureValue(value); + } + }; + return (
- + BP