Add popup prompt to confim user submission and to relaod page once user closes popup
This commit is contained in:
parent
8d4a4452f2
commit
d86dd487b1
|
@ -67,6 +67,8 @@ export function MyForm(props) {
|
||||||
const col = collection(db, `incidents`)
|
const col = collection(db, `incidents`)
|
||||||
const ref = await addDoc(col, incidentsData)
|
const ref = await addDoc(col, incidentsData)
|
||||||
console.log(ref)
|
console.log(ref)
|
||||||
|
alert("Form submitted successfully!");
|
||||||
|
window.location.reload();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create form for user to imput data
|
// Create form for user to imput data
|
||||||
|
@ -167,7 +169,6 @@ export function MyForm(props) {
|
||||||
<Button type="submit">Submit</Button>
|
<Button type="submit">Submit</Button>
|
||||||
</Col>
|
</Col>
|
||||||
</Form.Group>
|
</Form.Group>
|
||||||
<p>Refresh once submitted to see result added below.</p>
|
|
||||||
|
|
||||||
<Form.Group>
|
<Form.Group>
|
||||||
<h2>Existing incidents in the database:</h2>
|
<h2>Existing incidents in the database:</h2>
|
||||||
|
|
Loading…
Reference in New Issue