Presently, my method involves utilizing Firebase to store data. Upon receiving a response from Firebase, I aim to display an alert message and then refresh the form page. Below you can find the code snippet that I am currently working with:
// Save new inquiry to database using specified values
inquiry.push({
"name": name,
"contact": contact,
"email": email,
"board": board,
"subject": subject,
"standard": standard,
"message": message,
}).then(() => {
alert("Thank You! Your request has been received and our team will get in touch with you shortly.");
});
The issue is that either the alert message shows up or the page refreshes, but both actions are not happening simultaneously. Therefore, my question is how can I achieve displaying the alert message first and then refreshing the form page?