Skip to content

Commit

Permalink
changes with validation
Browse files Browse the repository at this point in the history
  • Loading branch information
yotzkim committed Feb 16, 2024
1 parent 4146ee3 commit 2d49188
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 18 deletions.
3 changes: 0 additions & 3 deletions frontend/src/app/vsr/page.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,3 @@
height: 56px;
}

.bottom {

}
5 changes: 0 additions & 5 deletions frontend/src/app/vsr/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ const VeteranServiceRequest: React.FC = () => {
control,
formState: { errors },
watch,
setValue,
} = useForm<IFormInput>();
const [selectedEthnicity, setSelectedEthnicity] = useState("");

Expand Down Expand Up @@ -86,8 +85,6 @@ const VeteranServiceRequest: React.FC = () => {
"Prefer not to say",
];

// Determine if the "Other" textbox should be shown
const showOtherTextbox = selectedEthnicity?.length === 0 || selectedEthnicity === undefined;

const onSubmit: SubmitHandler<IFormInput> = async (data) => {
console.log(data);
Expand Down Expand Up @@ -387,7 +384,6 @@ const VeteranServiceRequest: React.FC = () => {
</div>
</div>
</div>
<div className={styles.bottom}>
<div className={styles.submitButton}>
<button className={styles.submit} type="submit">
Submit
Expand All @@ -396,7 +392,6 @@ const VeteranServiceRequest: React.FC = () => {
<PageNumber
pageNum={1}
/>
</div>
</div>
</form>
</div>
Expand Down
10 changes: 0 additions & 10 deletions frontend/src/util/validateResponses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,6 @@ export function isnum(num: string): boolean {
return /^\d+$/.test(num);
}

export function validateDate(date: string): string {
//2 digit number / 2 digit number / 4 digit number
const dateRegex = /^\d{4}\-\d{2}\-\d{2}$/;
if (dateRegex.test(date)) {
return "Success";
} else {
return "Date is not in the correct format";
}
}

export function validateAge(age: string): string {
if (!isnum(age)) {
return "Age is not a number";
Expand Down

0 comments on commit 2d49188

Please sign in to comment.