18 lines
536 B
JavaScript
18 lines
536 B
JavaScript
document.getElementById("formConcierto").addEventListener("submit", function(e) {
|
|
e.preventDefault();
|
|
|
|
let formData = new FormData(this);
|
|
|
|
fetch("../php/insertar_concierto.php", {
|
|
method: "POST",
|
|
body: formData
|
|
})
|
|
.then(response => response.text())
|
|
.then(data => {
|
|
console.log("Respuesta del servidor:", data);
|
|
this.reset();
|
|
window.location.href = "../views/index.html"; // Redirigir al inicio sin alert
|
|
})
|
|
.catch(error => console.error("Error:", error));
|
|
});
|