Welcome To Snipplr
Everyone's Recent JavaScript Snippets
- All /
- JavaScript /
- HTML /
- PHP /
- CSS /
- Ruby /
- Objective C
Nombre: ParseNIF.
Recibe: cadena texto. por ejemplo un campo de texto de formulario.
Devuelve: true si cadena es un NIF valido, sino false.
0
556
posted 13 years ago by alberomo
Descripcion: Validar preguntas obligatorias con radio
Recibe: Objeto radio de un formulario
Devuelve: true si hay alguno que se encuentra checked, sino false.
0
571
posted 13 years ago by alberomo
Descripcion: Evalua el formato de una cadena String en cuanto a si es una Dir. Correo.
Recibe: Cadena como un String
Devuelve: true si Cadena es direccion de Correo. false en caso de no tener formato adecuado.
0
684
posted 13 years ago by alberomo
Descripción: Valida los campos que deben ser un número enviados por la función validaForm-->http://snipplr.com/view/58245/funcin-validaform-para-validar-formularios-con-parmetros-xml-y-nombres-de-clase/. En el caso de que no sea validado, llama a...
0
692
posted 13 years ago by alberomo
Descripción: Valida los campos obligatorios enviados por la función validaForm-->http://snipplr.com/view/58245/funcin-validaform-para-validar-formularios-con-parmetros-xml-y-nombres-de-clase/. En el caso de que no sea validado, llama a la función...
0
541
posted 13 years ago by alberomo
Descripción: Envia un formulario cuando se acciona el evento 'submit'
Devuelve: La función de validación con el objeto formulario del documento.
Requiere de: función envio_form() -->http://snipplr.com/view/58245/funcin-validaform-para-validar-...
0
680
posted 13 years ago by alberomo
Descripción: Recorre los objetos formulario buscando elementos/campos que deben validarse y que envia como parámetros. Llama a las diferentes funciones de validación, en función de los nombres de la clases introducidos.* Además, definie parámet...
0
789
posted 13 years ago by alberomo
Restricts the characters that are entered into a textbox. Also limits the length of the value to 5.
0
781
posted 13 years ago by Krummelz
Check if user has intruded a real email address. Return true (real email) or false (fake email).
Arguments: Element from a form.
From book Dom Scripting by Jeremy Keith
0
1135
posted 13 years ago by alberomo
Arguments: Element from a form.
Take that element and checks if is filled. If not, returns false. If is filled, returns true.
From book Dom Scripting by Jeremy Keith
0
1117
posted 13 years ago by alberomo
A JS function that put the focus in the form field associated to a label element whenever is clicked. The for atributte of the label element must match the id attribute of the associated form field.
It takes no arguments.
From book Dom Scripting by...
0
670
posted 13 years ago by alberomo
JS Function that style sibling elements of a given tag. Arguments: tag of the element We want siblings to style and name of the class we want to add. It needs the class to be styled (using CSS). It uses getNextElement function and addClass functions....
0
474
posted 13 years ago by alberomo
A JS function that makes bold the text of table rows ("tr" elements) when you "mouseover" them. It takes no arguments.
From book Dom Scripting by Jeremy Keith.
0
453
posted 13 years ago by alberomo
A JS function that stripes the tables ("table" elements) of a document. It takes no arguments. Add a new class ("odd") to the odd rows that needs to be styled using CSS. Use addClass function.
From book Dom Scripting by Jeremy Keith.
0
538
posted 13 years ago by alberomo
A JS function that returns the next element of a node. Argument: The node you want to know next element.
From book Dom Scripting by Jeremy Keith.
0
593
posted 13 years ago by alberomo
JS function that takes the accesskey attribute of the links of the document and display them at the end of the document. Takes no arguments.
From book Dom Scripting by Jeremy Keith.
0
488
posted 13 years ago by alberomo
JS function that add a link included in the cite attribute of the blackquote HTML element as sup element close to the blackquote. Takes no argument.
From book Dom Scripting by Jeremy Keith.
0
482
posted 13 years ago by alberomo
This is just a simple explanation of how to use the HTML5 local storage in javascript. The link has a more thorough explanation and an example for those interested. The examples to save, retrive, and clear are marked below.
0
776
posted 13 years ago by FatFolderDesigner
Given an iframe element and a header element, make the iframe just high enough to fit in the browser window. On window resize, readjust. Keep a minimum height for the iframe.
0
946
posted 13 years ago by kendsnyder
CSS:
.error
style the error class
Form HTML:
class="required"
makes the input field required
minlength="2"
makes the field require at least 2 characters
0
840
posted 13 years ago by redconservatory
image rollovers in jquery are usually super easy. However it sucks when working with absolute image paths - like a separate media server or CDN. Heres a quick snippet using substring and lastIndexOf to swap out the image src.
0
837
posted 13 years ago by inreflection7