Accueil > > > CHANGEMENT DU STYLE DES ZONES DE TEXTE PENDANT LA FOCALISATION
CHANGEMENT DU STYLE DES ZONES DE TEXTE PENDANT LA FOCALISATION
Information sur la source
Description
Ce simple code javascript inséré en HTML permet le changement du style (couleur et la taille de la police la taille de la bordure ainsi que la couleur de l'arrière-plan de cette zone) quand elle reçoit la focalisation pour savoir ou on est dans le formulaire. Qaund on passe à une autre zone du formulaire la première retrouve son style d'origine pour une autre en focalisation et ainsi de suite.. C'est simple beau et pratique, non? E-mail: sidoummoudz@yahoo.fr
Source
- <html>
-
- <head>
- <title>Changer et rétablir le style des zones de texte par les évènements onFocus onBlur</title>
- <meta name="generator" content="Namo WebEditor v5.0">
- </head>
-
- <body bgcolor="white" text="black" link="blue" vlink="purple" alink="red">
- <p align="center"><br><font face="Arial"><b>Changer et rétablir le style
- des zones de texte par les évènements onFocus onBlur<br>
-
- </b></font><p align="center"><br>
- </p>
- <form name="form5">
- <table cellpadding="0" cellspacing="0" width="392">
- <tr>
- <td width="153" height="30">
- <p align="right"><font face="Arial"><span style="font-size:10pt;">Nom</span></font></p>
- </td>
- <td width="223" height="30"> <p><input type="text" name="formtext1" size="30" style="border-width:1px; border-color:black"
- onFocus="javascript:this.style.backgroundColor='#E6DFDF';this.style.color='Navy';this.style.fontWeight='bold';this.style.borderWidth='2px'"
- onBlur="javascript:this.style.backgroundColor='';this.style.color='';this.style.fontWeight='';this.style.borderWidth='1px'"></p>
- </td>
- </tr>
- <tr>
- <td width="153" height="30">
- <p align="right"><font face="Arial"><span style="font-size:10pt;">Prénom</span></font></p>
- </td>
- <td width="223" height="30"> <p><input type="text" name="formtext1" size="30" style="border-width:1px; border-color:black"
- onFocus="javascript:this.style.backgroundColor='#E6DFDF';this.style.color='Navy';this.style.fontWeight='bold';this.style.borderWidth='2px'"
- onBlur="javascript:this.style.backgroundColor='';this.style.color='';this.style.fontWeight='';this.style.borderWidth='1px'"></p>
- </td>
- </tr>
- <tr>
- <td width="153" height="30">
- <p align="right"><font face="Arial"><span style="font-size:10pt;">Adresse</span></font></p>
- </td>
- <td width="223" height="30"><p><input type="text" name="formtext1" size="30" style="border-width:1px; border-color:black"
- onFocus="javascript:this.style.backgroundColor='#E6DFDF';this.style.color='Navy';this.style.fontWeight='bold';this.style.borderWidth='2px'"
- onBlur="javascript:this.style.backgroundColor='';this.style.color='';this.style.fontWeight='';this.style.borderWidth='1px'"></p>
- </td>
- </tr>
- <tr>
- <td width="153" height="30">
- <p align="right"><font face="Arial"><span style="font-size:10pt;">Tel</span></font></p>
- </td>
- <td width="223" height="30"> <p><input type="text" name="formtext1" size="30" style="border-width:1px; border-color:black"
- onFocus="javascript:this.style.backgroundColor='#E6DFDF';this.style.color='Navy';this.style.fontWeight='bold';this.style.borderWidth='2px'"
- onBlur="javascript:this.style.backgroundColor='';this.style.color='';this.style.fontWeight='';this.style.borderWidth='1px'"></p>
- </td>
- </tr>
- <tr>
- <td width="153" height="30">
- <p align="right"><font face="Arial"><span style="font-size:10pt;">Email</span></font></p>
- </td>
- <td width="223" height="30"> <p><input type="text" name="formtext1" size="30" style="border-width:1px; border-color:black"
- onFocus="javascript:this.style.backgroundColor='#E6DFDF';this.style.color='Navy';this.style.fontWeight='bold';this.style.borderWidth='2px'"
- onBlur="javascript:this.style.backgroundColor='';this.style.color='';this.style.fontWeight='';this.style.borderWidth='1px'"></p>
- </td>
- </tr>
- <tr>
- <td width="153" height="30">
- <p align="right"><font face="Arial"><span style="font-size:10pt;">Site
- Web</span></font></p>
- </td>
- <td width="223" height="30"> <p><input type="text" name="formtext1" size="30" style="border-width:1px; border-color:black"
- onFocus="javascript:this.style.backgroundColor='#E6DFDF';this.style.color='Navy';this.style.fontWeight='bold';this.style.borderWidth='2px'"
- onBlur="javascript:this.style.backgroundColor='';this.style.color='';this.style.fontWeight='';this.style.borderWidth='1px'"></p>
- </td>
- </tr>
- </table>
- </form>
- <p> </p>
- </body>
-
- </html>
<html>
<head>
<title>Changer et rétablir le style des zones de texte par les évènements onFocus onBlur</title>
<meta name="generator" content="Namo WebEditor v5.0">
</head>
<body bgcolor="white" text="black" link="blue" vlink="purple" alink="red">
<p align="center"><br><font face="Arial"><b>Changer et rétablir le style
des zones de texte par les évènements onFocus onBlur<br>
</b></font><p align="center"><br>
</p>
<form name="form5">
<table cellpadding="0" cellspacing="0" width="392">
<tr>
<td width="153" height="30">
<p align="right"><font face="Arial"><span style="font-size:10pt;">Nom</span></font></p>
</td>
<td width="223" height="30"> <p><input type="text" name="formtext1" size="30" style="border-width:1px; border-color:black"
onFocus="javascript:this.style.backgroundColor='#E6DFDF';this.style.color='Navy';this.style.fontWeight='bold';this.style.borderWidth='2px'"
onBlur="javascript:this.style.backgroundColor='';this.style.color='';this.style.fontWeight='';this.style.borderWidth='1px'"></p>
</td>
</tr>
<tr>
<td width="153" height="30">
<p align="right"><font face="Arial"><span style="font-size:10pt;">Prénom</span></font></p>
</td>
<td width="223" height="30"> <p><input type="text" name="formtext1" size="30" style="border-width:1px; border-color:black"
onFocus="javascript:this.style.backgroundColor='#E6DFDF';this.style.color='Navy';this.style.fontWeight='bold';this.style.borderWidth='2px'"
onBlur="javascript:this.style.backgroundColor='';this.style.color='';this.style.fontWeight='';this.style.borderWidth='1px'"></p>
</td>
</tr>
<tr>
<td width="153" height="30">
<p align="right"><font face="Arial"><span style="font-size:10pt;">Adresse</span></font></p>
</td>
<td width="223" height="30"><p><input type="text" name="formtext1" size="30" style="border-width:1px; border-color:black"
onFocus="javascript:this.style.backgroundColor='#E6DFDF';this.style.color='Navy';this.style.fontWeight='bold';this.style.borderWidth='2px'"
onBlur="javascript:this.style.backgroundColor='';this.style.color='';this.style.fontWeight='';this.style.borderWidth='1px'"></p>
</td>
</tr>
<tr>
<td width="153" height="30">
<p align="right"><font face="Arial"><span style="font-size:10pt;">Tel</span></font></p>
</td>
<td width="223" height="30"> <p><input type="text" name="formtext1" size="30" style="border-width:1px; border-color:black"
onFocus="javascript:this.style.backgroundColor='#E6DFDF';this.style.color='Navy';this.style.fontWeight='bold';this.style.borderWidth='2px'"
onBlur="javascript:this.style.backgroundColor='';this.style.color='';this.style.fontWeight='';this.style.borderWidth='1px'"></p>
</td>
</tr>
<tr>
<td width="153" height="30">
<p align="right"><font face="Arial"><span style="font-size:10pt;">Email</span></font></p>
</td>
<td width="223" height="30"> <p><input type="text" name="formtext1" size="30" style="border-width:1px; border-color:black"
onFocus="javascript:this.style.backgroundColor='#E6DFDF';this.style.color='Navy';this.style.fontWeight='bold';this.style.borderWidth='2px'"
onBlur="javascript:this.style.backgroundColor='';this.style.color='';this.style.fontWeight='';this.style.borderWidth='1px'"></p>
</td>
</tr>
<tr>
<td width="153" height="30">
<p align="right"><font face="Arial"><span style="font-size:10pt;">Site
Web</span></font></p>
</td>
<td width="223" height="30"> <p><input type="text" name="formtext1" size="30" style="border-width:1px; border-color:black"
onFocus="javascript:this.style.backgroundColor='#E6DFDF';this.style.color='Navy';this.style.fontWeight='bold';this.style.borderWidth='2px'"
onBlur="javascript:this.style.backgroundColor='';this.style.color='';this.style.fontWeight='';this.style.borderWidth='1px'"></p>
</td>
</tr>
</table>
</form>
<p> </p>
</body>
</html>
Sources de la même categorie
Commentaires et avis
Discussions en rapport avec ce code source dans le forum
Focus dans une textBox [ par monaco63 ]
Bonjour,J'ai un petit soucis sur une application codé en C#.J'ai une page qui contient une grille (tableau), quand je clique à l'intérieur d'une de me
css dynamique [ par lilj ]
Bonjour, je cherche une méthode simple pour changer la classe d'un input. Exemple: au début on a un input avec un style, lorsque le focus est activé
effet fade in [ par robbox89 ]
Bonjour à tous Débutant en Java j'aurai besoin d'aide pour un effet d'affichage Sur ma page web j'ai deux sections La partie de gauche est réservée
Afficher / cacher (un seul s'affiche à la fois) [ par charlie101097 ]
bonjour, En théorie, c'est d'après moi la bonne partie pour poster. Après avoir épluché le forum sur mon problème, je décide de poster car je n'ai pas
getElementById problème (style) [ par arbilus ]
Bonjour, pouvez-vous m'expliquer pourquoi cela ne fonctionne pas (l'iframe n'est pas à 1px ) : [code=js] function h1(){ document.getElementById('
probleme avec mon code avec firefox et opera [ par savagestudio ]
bonjour (mon clavier et en norvegien, desole [^^sad2]) , J ai u probleme avec mon code , il marche parfaitment avec safari, chrome,IE mais pas avec fi
modifier le list-style-Image CSS grace à l'évènement onmouseover [ par celili40 ]
J'avoue tout de suite, je n'ai pas encore commencé le cours de javascript et mis à part le livre que j'ai englouti sur la question, je n'ai pas beauco
Affichage visionneuse [ par ggodefroid ]
Bonjour j'aimerais obtenir l'effet que l'on a quand on clique sur les onglets connexion/déconnexion de ce site j'ai déja la visionneuse qui fonctionne
menu onglets style site NVIDIA [ par ju0123456789 ]
Bonjour, J'aimerais utiliser un systeme d'onglets similaire à la page d'accueil du site nvidia http://www.nvidia.fr Quand on passe la souris sur un
selectionné un élément dans mon select [ par KaiHo ]
Bonjour Je me trouve face à un souci qui me semblait simple à résoudre, mais je sèche. En fait, j'ai un élément "select" d'un formulaire qui doit se
|
Derniers Blogs
IMAGINE CUP 2012, MAKE A SIGN EN FINALEIMAGINE CUP 2012, MAKE A SIGN EN FINALE par junarnoalg
Voilà qui est fait, la nouvelle est officielle ! L'équipe belge "Make a Sign" va au pays des kangourous défendre son projet dans la catégorie Software Design. http://www.imaginecup.com/CompetitionsContent/Competition/WorldwideFinalists.aspx V...
Cliquez pour lire la suite de l'article par junarnoalg KINECT 1.5 IS OUT !KINECT 1.5 IS OUT ! par Vko
La version 1.5 du Kinect For Microsoft vient tout juste de sortir ! Plein de nouveautés: Tracking de squelette en Near Mode Détection en position assise Détection faciale avec un SDK dédié Documentation et des guideline (enfin) Un out...
Cliquez pour lire la suite de l'article par Vko LES ACTUALITéS DE LA SEMAINE SUR C2I.FR (14 MAI - 20 MAI) LES ACTUALITéS DE LA SEMAINE SUR C2I.FR (14 MAI - 20 MAI) par richardc
Mise à jour des Web API du 14 Mai
Réservez dès maintenant votre journée du 20 juin pour le Windows Azure Dev Camp 2012 à Paris
Mise à jour de Team Foundation Service
MechCommander 2 sur Windows 8
Entity Framework 5 Release Candidate e...
Cliquez pour lire la suite de l'article par richardc REACTIVE EXTENSIONS : CONSOMMER DES SERVICES AVEC RX PARTIE 3, LES PIèGES à éVITERREACTIVE EXTENSIONS : CONSOMMER DES SERVICES AVEC RX PARTIE 3, LES PIèGES à éVITER par Groc
Une mauvaise utilisation de rx lors de l'écriture d'une couche d'accès à des services peut conduire à des cas embarassants avec des erreurs mal gérées, des appels qui ne partent lorsqu'ils le devraient, et même des résultats incorrects . le tout nuis...
Cliquez pour lire la suite de l'article par Groc SHAREPOINT BLOG SITE, PROBLèME D'ARCHIVESSHAREPOINT BLOG SITE, PROBLèME D'ARCHIVES par junarnoalg
Dernièrement, nous avons migré le site
myTIC
vers un nouveau serveur SharePoint 2010. Dans les contenus que nous vouloins récupérer, nous avions un certain nombre de blogs.
Nous avons utilisé les commandes Power...
Cliquez pour lire la suite de l'article par junarnoalg
Forum
UTILISER UN .JSUTILISER UN .JS par zaikoe
Cliquez pour lire la suite par zaikoe
Logiciels
sDEVIS-FACTURES vlPRO (8.1.0.3)SDEVIS-FACTURES VLPRO (8.1.0.3)sDEVIS-FACTURES vlPRO a été mis au point pour les particuliers, créateurs, entrepreneurs, artisa... Cliquez pour télécharger sDEVIS-FACTURES vlPRO 974 Application Server (12.2.4.6)974 APPLICATION SERVER (12.2.4.6)Développez de puissantes applications dans un environnement de 'cloud computing', clusterisé, séc... Cliquez pour télécharger 974 Application Server vPicture (1.4.2.1)VPICTURE (1.4.2.1)Avec vPicture, hébergez vos images facilement et rapidement.
vPicture est un utilitaire simple, ... Cliquez pour télécharger vPicture Easy-Planning (2.2.1.6)EASY-PLANNING (2.2.1.6)Easy-Planning permet de créer des plannings sous la représentation de diagrammes et est adapté au... Cliquez pour télécharger Easy-Planning COM-BACKUP (2.0)COM-BACKUP (2.0)
COM-BACKUP est un logiciel de sauvegarde qui permet de planifier les sauvegardes de vos dossiers ...
Cliquez pour télécharger COM-BACKUP
|