Add popup prompt to confim user submission and to relaod page once user closes popup

This commit is contained in:
Ray 2023-12-30 08:54:24 +00:00 committed by GitHub
parent 8d4a4452f2
commit d86dd487b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -67,6 +67,8 @@ export function MyForm(props) {
const col = collection(db, `incidents`)
const ref = await addDoc(col, incidentsData)
console.log(ref)
alert("Form submitted successfully!");
window.location.reload();
}
// Create form for user to imput data
@ -167,7 +169,6 @@ export function MyForm(props) {
<Button type="submit">Submit</Button>
</Col>
</Form.Group>
<p>Refresh once submitted to see result added below.</p>
<Form.Group>
<h2>Existing incidents in the database:</h2>