Articulos PHP
- 2.7 Enlazar un programas con include.
- 3.1 Conexión MySQL con enunciado die.
- 1.1 Variables en PHP
- 1.2 Enunciados de salida echo.
- 2.3 Ciclo FOR avanzado.
Warning: Use of undefined constant php - assumed 'php' (this will throw an Error in a future version of PHP) in /home/vhosts/lawebderay.orgfree.com/articulos.php on line 128
Articulos Jquery
- 2 Añadiendo elementos a la página con append().
- 2.5 Recorriendo el array con each().
- 1.8 Creando elementos con Jquery
- 2.7 Listas desplegables con change()
- 3.1 Callback en Jquery
Warning: Use of undefined constant jquery - assumed 'jquery' (this will throw an Error in a future version of PHP) in /home/vhosts/lawebderay.orgfree.com/articulos.php on line 137
Articulos CSS
- 1.2 Estructura de los estilos CSS.
- 1.1 Como incluir estilos en una página web.
- 1 Hojas de estilo CSS.
Warning: Use of undefined constant css - assumed 'css' (this will throw an Error in a future version of PHP) in /home/vhosts/lawebderay.orgfree.com/articulos.php on line 146
Articulos Mysql
- 2.6 Combinando resultados con UNION ALL.
- 3 Actualizar valores con UPDATE.
- 2.1 Seleccionando registros con BETWEEN y WHERE
- 2.3 Seleccionando registros con NOT IN.
- 3.3 Definición para columnas.
Warning: Use of undefined constant mysql - assumed 'mysql' (this will throw an Error in a future version of PHP) in /home/vhosts/lawebderay.orgfree.com/articulos.php on line 155
Warning: Use of undefined constant tema - assumed 'tema' (this will throw an Error in a future version of PHP) in /home/vhosts/lawebderay.orgfree.com/articulos.php on line 199
Warning: Use of undefined constant tema - assumed 'tema' (this will throw an Error in a future version of PHP) in /home/vhosts/lawebderay.orgfree.com/articulos.php on line 220
Warning: Use of undefined constant id - assumed 'id' (this will throw an Error in a future version of PHP) in /home/vhosts/lawebderay.orgfree.com/articulos.php on line 220
1.6 El método preventDefault().
El método preventDefault() se utiliza para impedir que un determinado evento se ejecute con normalidad, es decir, hace que un determinado evento se interrumpa. Recordemos que un evento puede ser cualquier acción realizada por el usuario.Ahora para entender su funcionamiento, supongamos que deseamos tener un campo de texto y que deseamos que no se pueda introducir texto dentro de este último (algo muy extraño, pero ilustrativo), el campo de texto sería el siguiente:
<input type=”text” size=”30” class=”campoPrueba”/>
Entonces el código Jquery necesario sería el siguiente:
$(document).ready(function(){
$(“.campoPrueba”).keypress(function(evento){
evento.preventDefault();
});
});
El código consiste en lo siguiente:
- La primera parte $(document).ready(function(){}); permite que el código de Jquery se ejecute hasta que se haya descargado correctamente todo el código HTML.
- La segunda parte $(“.campoPrueba”).keypress(function(evento){…}); es la encargada de contener el código a ejecutarse cada vez que el usuario ingrese un carácter. Es importante mencionar que evento hace referencia a la acción llevada a cabo por el usuario, en este caso, ingresar un carácter.
- La tercera y última parte evento.preventDefault(); se encarga de impedir que el evento de ingresar un carácter se lleve a cabo.
Warning: Use of undefined constant tema - assumed 'tema' (this will throw an Error in a future version of PHP) in /home/vhosts/lawebderay.orgfree.com/articulos.php on line 225
El método preventDefault.
Warning: Use of undefined constant id - assumed 'id' (this will throw an Error in a future version of PHP) in /home/vhosts/lawebderay.orgfree.com/articulos.php on line 225
1.6



