From f5a354025e0a4085464a296cf2a6c453d015c678 Mon Sep 17 00:00:00 2001 From: "v.rodriguezcamacho" Date: Tue, 29 Sep 2026 11:24:42 +0200 Subject: [PATCH] Toast de confirmacion de pregunta creada --- js/perfil.js | 12 +++++++++++- perfil.php | 13 +++++++++++-- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/js/perfil.js b/js/perfil.js index d4c3a02..02859fb 100644 --- a/js/perfil.js +++ b/js/perfil.js @@ -231,6 +231,8 @@ $("#formCrearPregunta").on("submit", function (e) { // Volvemos a activar el botón boton.prop("disabled", false); boton.text("Crear pregunta"); + // Toast exito + mostrarToast() } }, @@ -243,4 +245,12 @@ $("#formCrearPregunta").on("submit", function (e) { boton.text("Crear pregunta"); }, }); -}); \ No newline at end of file +}); +function mostrarToast() { + const toastMensaje = document.getElementById("ToastCrearPregunta"); + + if (toastMensaje) { + const toastBootstrap = bootstrap.Toast.getOrCreateInstance(toastMensaje); + toastBootstrap.show(); + } +} \ No newline at end of file diff --git a/perfil.php b/perfil.php index 4cf3339..0488cfe 100644 --- a/perfil.php +++ b/perfil.php @@ -174,8 +174,17 @@ $avatarUsuario = htmlspecialchars($_SESSION['avatar'] ?? 'img/avatars/defaultPro - - + +
+ +