begin process at 2012 05 28 13:24:27
  Trouver un code source :
 
dans
 
Accueil > 

Code

 > 

Formulaire

 > DÉSACTIVER LA TOUCHE ENTRER DANS UN TEXTAREA

DÉSACTIVER LA TOUCHE ENTRER DANS UN TEXTAREA


 Information sur la source

Note :
2,67 / 10 - par 3 personnes
2,67 / 10

  • 1

  • 2

  • 3

  • 4

  • 5

  • 6

  • 7

  • 8

  • 9

  • 10
Catégorie :Formulaire Niveau :Débutant Date de création :25/04/2005 Vu / téléchargé :8 928 / 139

Auteur : hotlines

Ecrire un message privé
Site perso
Commentaire sur cette source (4)
Ajouter un commentaire et/ou une note

 Description

ce script permet de désactiver la touche Entrer dans un TextArea.

Source

  • <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
  • <html>
  • <head>
  • <title>Document sans nom</title>
  • <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  • <style type="text/css">
  • <!--
  • .Style1 {
  • color: #000000;
  • font-size: 10px;
  • font-family: Geneva, Arial, Helvetica, sans-serif;
  • font-weight: bold;
  • }
  • -->
  • </style>
  • <script language="javascript1.2">
  • function BloqSubmit()
  • {
  • if (window.event.type == "keypress" & window.event.keyCode == 13)
  • {
  • alert("attention ! la touche Entrer est désactivée")
  • event.returnValue = false
  • }
  • }
  • </script>
  • </head>
  • <body>
  • <table width="750" border="0" cellpadding="0" cellspacing="0">
  • <!--DWLayoutTable-->
  • <tr>
  • <td width="218" height="87">&nbsp;</td>
  • <td width="324">&nbsp;</td>
  • <td width="208">&nbsp;</td>
  • </tr>
  • <tr>
  • <td height="198">&nbsp;</td>
  • <td valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
  • <!--DWLayoutTable-->
  • <tr>
  • <td width="274" height="24" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#66CCFF">
  • <!--DWLayoutTable-->
  • <tr>
  • <td width="12" height="4"></td>
  • <td width="262"></td>
  • </tr>
  • <tr>
  • <td height="12"></td>
  • <td valign="top"><span class="Style1">Cliquer sur la toucher entrer </span></td>
  • </tr>
  • <tr>
  • <td height="8"></td>
  • <td></td>
  • </tr>
  • </table></td>
  • <td width="50">&nbsp;</td>
  • </tr>
  • <tr>
  • <td height="152" colspan="2" valign="top"><form name="form1" method="post" action="">
  • <textarea name="textarea" cols="50" rows="10" class="Style1" onKeyPress="BloqSubmit()"></textarea>
  • </form></td>
  • </tr>
  • <tr>
  • <td height="22">&nbsp;</td>
  • <td>&nbsp;</td>
  • </tr>
  • </table></td>
  • <td>&nbsp;</td>
  • </tr>
  • </table>
  • </body>
  • </html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
<html>
<head>
<title>Document sans nom</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
.Style1 {
	color: #000000;
	font-size: 10px;
	font-family: Geneva, Arial, Helvetica, sans-serif;
	font-weight: bold;
}
-->
</style>
<script language="javascript1.2">
function BloqSubmit() 
{  
if (window.event.type == "keypress" & window.event.keyCode == 13) 
  {
 alert("attention ! la touche Entrer est désactivée")
    event.returnValue = false
  }
}  

</script>
</head>

<body>
<table width="750" border="0" cellpadding="0" cellspacing="0">
  <!--DWLayoutTable-->
  <tr>
    <td width="218" height="87">&nbsp;</td>
    <td width="324">&nbsp;</td>
    <td width="208">&nbsp;</td>
  </tr>
  <tr>
    <td height="198">&nbsp;</td>
    <td valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
        <!--DWLayoutTable-->
        <tr>
          <td width="274" height="24" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#66CCFF">
              <!--DWLayoutTable-->
              <tr>
                <td width="12" height="4"></td>
                <td width="262"></td>
              </tr>
              <tr>
                <td height="12"></td>
                <td valign="top"><span class="Style1">Cliquer sur la toucher entrer </span></td>
              </tr>
              <tr>
                <td height="8"></td>
                <td></td>
              </tr>
                                  </table></td>
      <td width="50">&nbsp;</td>
        </tr>
        <tr>
          <td height="152" colspan="2" valign="top"><form name="form1" method="post" action="">
          <textarea name="textarea" cols="50" rows="10" class="Style1" onKeyPress="BloqSubmit()"></textarea>
          </form></td>
      </tr>
        <tr>
          <td height="22">&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
    </table></td>
    <td>&nbsp;</td>
  </tr>
</table>
</body>
</html>

 Conclusion

j'espere que ce script vous sera utile.

 Fichier Zip

Les Membres Club peuvent télécharger directement un fichier contenu dans le zip sans télécharger le zip en entier !

Télécharger le zip


 Sources de la même categorie

Source avec Zip Source avec une capture FORMULAIRE TABLEAU par vic511
Source avec Zip Source avec une capture FORMULAIRE DYNAMIQUE par Niidhogg
Source avec Zip Source avec une capture CONTRAINTE DE SAISIE SUR CHAMPS INPUT par ryosama
SELECTS DÉPENDANTS PRÉ-CHARGÉS D'UNE SEULE OPTION par phm
Source avec Zip Source avec une capture BOITE DE DIALOGUE MODALE DE SÉLECTION D'UNE LISTE D'ICONES par JJDai

Commentaires et avis

Commentaire de Arto_8000 le 26/04/2005 03:00:19

C'est la même chose que cette source :

http://www.javascriptfr.com/code.aspx?ID=15782

Tu as juste rajouter du code HTML !

Commentaire de chankalan le 09/07/2006 20:59:19

ce script n'a rien voulu savoir, mais celui-ci oui :
[code]
<SCRIPT language="JavaScript">
var n4 = window.Event ? true : false; // NN4 ou plus
function process_keypress(e)
{
var whichCode = -1
if (n4) var whichCode = e.which // Navigator 4x

else // Internet Explorer 4x ou + (pas de parametre "e" disponible: utilisation window.event)

if (window.event.type == "keypress") whichCode = window.event.keyCode

//window.status="interception touche "+whichCode;
if (whichCode == 13)
{
// détection touche ENTER
alert("touche ENTREE inopérante.\n\nVeuillez choisir une option,\nou modifier votre demande puis cliquer sur RECHERCHER");
return false; // indispensable
}
}
// NN4 plante sur frappe du caractère circonflexe! on tente de ne plus intercepter les frappes clavier
//if (n4) document.captureEvents(Event.KEYPRESS);
document.onkeypress = process_keypress;
</SCRIPT>
[/code]

Commentaire de mateo95270 le 25/08/2006 00:04:43

C'est peut etre con mais c'est quoi un textarea ?

Commentaire de yurelias le 21/11/2006 16:31:05

tu voit le truc ou tu poste ton commentaire? c'est ça un text area,  ou zone de texte :)

 Ajouter un commentaire




Nos sponsors


Sondage...

Comparez les prix

CalendriCode

Mai 2012
LMMJVSD
 123456
78910111213
14151617181920
21222324252627
28293031   

Consulter la suite du CalendriCode

A découvrir



 
Développement réalisé par Nicolas SOREL (Nix) avec l'aide de : Cyril DURAND et Emmanuel (EBArtSoft), Merci à Vincent pour ses précieux conseils.
CodeS-SourceS.com© Toute reproduction même partielle est interdite sauf accord écrit du Webmaster
CodeS-SourceS.com© est une marque déposée tous droits réservés

Google Coop CodeS-SourceS Google Coop CodeS-SourceS
Temps d'éxécution de la page : 1,248 sec (4)

Nous contacter | Annoncer sur CodeS-SourceS | Mentions légales