michelc Blog

Just <strong>another</strong> WordPress.com weblog

Archive for avril 2005

Reconnaitre un numéro de sécurité sociale

leave a comment »

Trouvé sur http://u-blog.net/dda/note/11 où tout est expliqué.

([12][0-9][0-9](0[1-9]|1[0-2])(0[1-9]|[13456789][0-9]|2[023456789AB])[0-9][0-9][0-9][0-9][0-9][0-9])([0-9][0-9])

(publié à l’origine sur http://www.bigbold.com/snippets/posts/show/170)

Written by michel

15 avril 2005 at 3:30

Publié dans Code Snippets, regex

Confirmer la sortie d’un formulaire

leave a comment »

Cette méthode fonctionne avec Internet Explorer (testé avec IE6) et Firefox (testé avec FF 1.5)

window.onbeforeunload = function (evt) {
var message = 'Are you sure you want to leave?';
if (typeof evt == 'undefined') {
evt = window.event;
}
if (evt) {
evt.returnValue = message;
}
return message;
}

(publié à l’origine sur http://www.bigbold.com/snippets/posts/show/142)

Written by michel

11 avril 2005 at 1:07

Publié dans Code Snippets, javascript