Foros del Web » Programando para Internet » Javascript »

[SOLUCIONADO] Alert() Sencilla por Alert() Elegante

Estas en el tema de Alert() Sencilla por Alert() Elegante en el foro de Javascript en Foros del Web. Saludos, Tengo esta sintaxis, la cual se ejecuta bien, Código PHP: <?php $tipo_p = inputSeguro ( $_POST [ 'tipo_p' ]);   if( $tipo_p == 0 ){ ...
  #1 (permalink)  
Antiguo 12/11/2016, 19:51
 
Fecha de Ingreso: mayo-2005
Mensajes: 23
Antigüedad: 19 años
Puntos: 1
Alert() Sencilla por Alert() Elegante

Saludos,
Tengo esta sintaxis, la cual se ejecuta bien,
Código PHP:

<?php
$tipo_p
=inputSeguro($_POST['tipo_p']);
  if(
$tipo_p==0){
        echo 
"<script>alert('Seleccione El tipo de Personal .'); window.location.href=\"index.php\"</script>";
            
session_destroy();
}
?>
El alert() que se encuentra en el script quisiera colocarlo como un alert elegante.
  #2 (permalink)  
Antiguo 12/11/2016, 22:49
Avatar de enlinea777  
Fecha de Ingreso: mayo-2008
Ubicación: frente al pc
Mensajes: 1.830
Antigüedad: 16 años
Puntos: 127
Respuesta: Alert() Sencilla por Alert() Elegante

a que llamas alert elegante?
  #3 (permalink)  
Antiguo 12/11/2016, 23:37
Avatar de AngelKrak  
Fecha de Ingreso: noviembre-2014
Mensajes: 917
Antigüedad: 9 años, 5 meses
Puntos: 91
Respuesta: Alert() Sencilla por Alert() Elegante

pues para alerts elegantes hay muchos plugins, los mejores o los k mas me gustan son

JQUERY-CONFIRM
Alertify
Toastr
SweetAlert
Noty(vi la demo y se ve buena)

Pruebalas y usa la que mas te guste ;)
  #4 (permalink)  
Antiguo 13/11/2016, 10:18
 
Fecha de Ingreso: mayo-2005
Mensajes: 23
Antigüedad: 19 años
Puntos: 1
Respuesta: Alert() Sencilla por Alert() Elegante

Autorespondido tengo esta
Código PHP:
<?php 
$tipo_p
=inputSeguro($_POST['tipo_p']); 
  if(
$tipo_p==0){ 
        echo 
"<script>alert('Seleccione El tipo de Personal .'); window.location.href=\"index.php\"</script>"
            
session_destroy(); 

?>
Cambie por esto
Código PHP:
<head>
<
script src="sweetalert.min.js"></script>
<script src="sweetalert-dev.js"></script>
<link rel="stylesheet" type="text/css" href="sweetalert.css">
</head> 

if($tipo_p==0){
     echo '<script type="text/javascript">
           setTimeout(function () { 
            swal({
              title: "ERROR!",
              text: "Seleccione El tipo de Personal!",
              type: "error",
              confirmButtonText: "OK"
            },
            function(isConfirm){
              if (isConfirm) {
                window.location.href = "http://localhost:8089/fad/sgcd/";
              }
            }); }, 500);
            
            </script>';
            session_destroy();
    } 
  #5 (permalink)  
Antiguo 14/11/2016, 10:51
Avatar de Triby
Mod on free time
 
Fecha de Ingreso: agosto-2008
Ubicación: $MX->Gto['León'];
Mensajes: 10.106
Antigüedad: 15 años, 8 meses
Puntos: 2237
Respuesta: Alert() Sencilla por Alert() Elegante

Nada que ver con PHP, muevo tu tema a Javascript, a ver si allá entienden lo que pasa aquí.
__________________
- León, Guanajuato
- GV-Foto

Etiquetas: php, sencilla
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 16:32.