IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

JavaScript Discussion :

Apparition rapide lors du chargement d'un formulaire


Sujet :

JavaScript

  1. #1
    Membre éprouvé Avatar de lodan
    Profil pro
    Inscrit en
    Juin 2006
    Messages
    2 064
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juin 2006
    Messages : 2 064
    Par défaut Apparition rapide lors du chargement d'un formulaire
    Bonjour,

    J'ai ce scipt dans tous mes formulaires en fin de <body>

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    <script type="text/javascript" language="Javascript" >
    var Calendar = new TCalendar("Calendar");
    Calendar.MInitWeekDays(0,6);
    </script>
    Comment éviter lors du chargement d'un formulaire qu'apparaisse le calendrier.
    C'est très rapide, mais s'il était possible d'éviter son apparition cela m'arrangerait.

    Merci

  2. #2
    Expert confirmé
    Avatar de javatwister
    Homme Profil pro
    danseur
    Inscrit en
    Août 2003
    Messages
    3 684
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Calvados (Basse Normandie)

    Informations professionnelles :
    Activité : danseur

    Informations forums :
    Inscription : Août 2003
    Messages : 3 684
    Par défaut
    J'ai ce scipt dans tous mes formulaires en fin de <body>
    oui... un bel exemple de non sens;


    Comment éviter lors du chargement d'un formulaire qu'apparaisse le calendrier
    je n'en sais foutre rien n'ayant pas la moindre idée du contenu de l'objet TCalendar ni de la méthode MInitWeekDays

  3. #3
    Membre confirmé
    Profil pro
    Inscrit en
    Mai 2004
    Messages
    155
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mai 2004
    Messages : 155
    Par défaut
    si ton calendar s'afiche c'est qu'il apartient forcément à un noeud html (div, span, p...). Ce que tu pourrais faire c'est avec du css (ou directement dans le html) rendre invisible ce noeud (display: none en css ou style="display: none" dans le html). Et quand tu voudra l'afficher, avec du js, tu fera un .style.display = "block" ou autre

  4. #4
    Membre éprouvé Avatar de lodan
    Profil pro
    Inscrit en
    Juin 2006
    Messages
    2 064
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juin 2006
    Messages : 2 064
    Par défaut
    heu ! Non sens parcequ'il est dans tous les formulaires ou parcequ'il est dans le "<body>"

    Voici la fin de mon formulaire

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    </div>
     
    </form>
    <script type="text/javascript" language="Javascript" >
    var Calendar = new TCalendar("Calendar");
    Calendar.MInitWeekDays(0,6);
    </script>
    </body>
    </html>
    Pour le fun et parceque c'est gentiment demandé, le début de mon script

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    function TCalendar(id,position,x,y) {
    //Attribut
    	this.AId = id;
    	this.AFixedX = (x==undefined)?-1:x;			// x position (-1 if to appear below control)
    	this.AFixedY = (y==undefined)?-1:y;			// y position (-1 if to appear below control)
    	this.APosition = (position==undefined)?"absolute":position;
    	this.AStartAt = 1;			// 0 - sunday ; 1 - monday
    	this.AShowWeekNumber = 1;	// 0 - don't show; 1 - show
    	this.AShowToday = 1;		// 0 - don't show; 1 - show
    	this.AShowComment = 1;		// 0 - don't show; 1 - show
    	this.AShowLegend = 1;		// 0 - don't show; 1 - show
    	this.AStyleToday = "border-left: #CAC9C8 1px solid;border-top: #CAC9C8 1px solid;border-right: #333333 1px solid;border-bottom: #333333 1px solid;background-color:#B9B8B3;text-align:center;font-size:9pt;color:white;font-family: Arial Verdana;cursor:default;padding:1px;z-index:99";
    	this.AStyleCalendar = "border-left: #CAC9C8 1px solid;border-top: #CAC9C8 1px solid;border-right: #333333 1px solid;border-bottom: #333333 1px solid;background-color:#B9B8B3;text-align:left;font-size:9pt;color:white;font-family: Arial Verdana;cursor:default;padding:1px;z-index:99";
    	this.AStyleEntete = "border-left: #CAC9C8 1px solid;border-top: #CAC9C8 1px solid;border-right: #333333 1px solid;border-bottom: #333333 1px solid;background-color:#B9B8B3;text-align:left;font-size:9pt;color:white;font-family: Arial Verdana;cursor:default;padding:1px;z-index:99";
    	this.AStyleComment = "border-left: #CAC9C8 1px solid;border-top: #CAC9C8 1px solid;border-right: #333333 1px solid;border-bottom: #333333 1px solid;background-color:#B9B8B3;text-align:center;font-size:9pt;color:white;font-family: Arial Verdana;cursor:default;padding:1px;z-index:99";
    	this.AStyleLegend = "border-left: #CAC9C8 1px solid;border-top: #CAC9C8 1px solid;border-right: #333333 1px solid;border-bottom: #333333 1px solid;background-color:#B9B8B3;text-align:center;font-size:9pt;color:white;font-family: Arial Verdana;cursor:default;padding:1px;z-index:99";
    	this.AStyleComposantOut = "border-left: #CAC9C8 1px solid;border-top: #CAC9C8 1px solid;border-right: #333333 1px solid;border-bottom: #333333 1px solid;background-color:#B9B8B3;font-size:9pt;color:white;font-family: Arial Verdana;cursor:pointer;padding:1px;z-index:99";
    	this.AStyleComposantOver = "border-left: #333333 1px solid;border-top: #333333 1px solid;border-right: #CAC9C8 1px solid;border-bottom: #CAC9C8 1px solid;background-color:#777777;font-size:9pt;color:white;font-family: Arial Verdana;cursor:pointer;padding:1px;z-index:99";
    	this.AStyleCadrePopUp = "border-left: #CAC9C8 1px solid;border-top: #CAC9C8 1px solid;border-right: #333333 1px solid;border-bottom: #333333 1px solid;background-color:#B9B8B3;padding:1px;z-index:99";
    	this.AStyleButtonPopUpOut = "border-left: #CAC9C8 1px solid;border-top: #CAC9C8 1px solid;border-right: #333333 1px solid;border-bottom: #333333 1px solid;background-color:#B9B8B3;font-size:9pt;text-align:center;color:white;font-family: Arial Verdana;cursor:pointer;padding:1px;z-index:99";
    	this.AStyleButtonPopUpOver = "border-left: #333333 1px solid;border-top: #333333 1px solid;border-right: #CAC9C8 1px solid;border-bottom: #CAC9C8 1px solid;background-color:#777777;font-size:9pt;text-align:center;color:white;font-family: Arial Verdana;cursor:pointer;padding:1px;z-index:99";
     
    	this.AStyleCadreDay = "border-left: #CAC9C8 1px solid;border-top: #CAC9C8 1px solid;border-right: #333333 1px solid;border-bottom: #333333 1px solid;background-color:#B9B8B3;font-size:9pt;text-align:center;color:white;font-family: Arial Verdana;padding:1px;z-index:99";
    	this.AStyleButtonDayOut = "border-left: #CAC9C8 1px solid;border-top: #CAC9C8 1px solid;border-right: #333333 1px solid;border-bottom: #333333 1px solid;background-color:#B9B8B3;font-size:9pt;text-align:center;color:white;font-family: Arial Verdana;cursor:pointer;padding:1px;z-index:99";
    	this.AStyleButtonDayOver = "border-left: #333333 1px solid;border-top: #333333 1px solid;border-right: #CAC9C8 1px solid;border-bottom: #CAC9C8 1px solid;background-color:#777777;font-size:9pt;text-align:center;color:white;font-family: Arial Verdana;cursor:pointer;padding:1px;z-index:99";
    	this.AStyleButtonDayHoliday = "border-left: #CAC9C8 1px solid;border-top: #CAC9C8 1px solid;border-right: #333333 1px solid;border-bottom: #333333 1px solid;background-color:#ACC14E;font-size:9pt;text-align:center;color:white;font-family: Arial Verdana;cursor:pointer;padding:1px;z-index:99";
    	this.AStyleButtonDayWeek = "border-left: #CAC9C8 1px solid;border-top: #CAC9C8 1px solid;border-right: #333333 1px solid;border-bottom: #333333 1px solid;background-color:#DF9F15;font-size:9pt;text-align:center;color:white;font-family: Arial Verdana;cursor:pointer;padding:1px;z-index:99";
    	this.AStyleButtonDaySelected = "border-left: #CAC9C8 1px solid;border-top: #CAC9C8 1px solid;border-right: #333333 1px solid;border-bottom: #333333 1px solid;background-color:#7951AE;font-size:9pt;text-align:center;color:white;font-family: Arial Verdana;cursor:pointer;padding:1px;z-index:99";
    	this.AStyleButtonDayOld = "border-left: #CAC9C8 1px solid;border-top: #CAC9C8 1px solid;border-right: #333333 1px solid;border-bottom: #333333 1px solid;background-color:#51AE8D;font-size:9pt;text-align:center;color:white;font-family: Arial Verdana;cursor:pointer;padding:1px;z-index:99";
    	this.AStyleButtonDayUnselected = "border-left: #CAC9C8 1px solid;border-top: #CAC9C8 1px solid;border-right: #333333 1px solid;border-bottom: #333333 1px solid;background-color:#73091F;font-size:9pt;text-align:center;color:white;font-family: Arial Verdana;cursor:pointer;padding:1px;z-index:99";
    	this.AStyleNumberWeek = "background-color:#A1A19F;font-size:9pt;text-align:center;color:white;font-family: Arial Verdana;padding:1px";
    	this.AStyleNameDay = "background-color:#A1A19F;font-size:9pt;font-weight:bold;text-align:center;color:black;font-family: Arial Verdana;padding:1px";
     
      	this.ADaySpacing = 0;
    	this.ATypeAnim = 1;
    	this.AVitesseAnim = 7;
    	this.AImgDir = "../JS/images/";			// directory for images ... e.g. this.AImgDir="/img/"
    	this.ADayCloses = new Array([0]);
     
    	this.AGotoString = "Mois courant";
    	this.ATodayString = "Aujourd hui :";
    	this.AWeekString = "n°";
     
    	this.AScrollLeftMessage = "Cliquer pour passer au mois précédent. Maintenir le bouton de la souris enfoncé pour le défilement automatique.";
    	this.AScrollRightMessage = "Cliquer pour passer au mois suivant. Maintenir le bouton de la souris enfoncé pour le défilement automatique.";
    	this.AScrollLeftMessageYear = "Cliquer pour passer &agrave; l année précédente. Maintenir le bouton de la souris enfoncé pour le défilement automatique.";
    	this.AScrollRightMessageYear = "Cliquer pour passer &agrave; l année suivante. Maintenir le bouton de la souris enfoncé pour le défilement automatique.";
    	this.ASelectMonthMessage = "Cliquer pour sélectionner un mois.";
    	this.ASelectYearMessage = "Cliquer pour sélectionner année.";
    	this.ASelectDateMessage = "Choisir la date [date]."; // do not replace [date], it will be replaced by date.
     
    	this.AMonthSelected = "";
    	this.AYearSelected = "";
    	this.ADateSelected = "";
    	this.AOmonthSelected = "";
    	this.AOyearSelected = "";
    	this.AOdateSelected = "";
    	this.AMonthConstructed = false;
    	this.AYearConstructed = false;
    	this.AIntervalID1 = "";
    	this.AIntervalID2 = "";
    	this.ATimeoutID1 = "";
    	this.ATimeoutID2 = "";
    	this.ACtlToPlaceValue = null;
    	this.ACtlNow = null;
    	this.ADateFormat = "jj/mm/yyyy";
    	this.ANStartingYear = "";
    	this.ADayWeek = false;
    	this.ADayHoliday = false;
     	this.ABorne = null;
     
    	this.AToday =	new	Date();
    	this.ADateNow	 = this.AToday.getDate();
    	this.AMonthNow = this.AToday.getMonth();
    	this.AYearNow	 = this.AToday.getYear();
    	if (!MS) this.AYearNow += 1900;
     
    	this.ABShow = false;
    	this.ABPageLoaded=false;
     
    	this.AStrEaster = "Pâques";
    	this.AStrEasterMonday = "Lundi de Pâques";
    	this.AStrAscension = "Ascension";
    	this.AStrPentecostMonday = "Lundi de Pentecôte";
    	this.AStrPentecost = "Pentecôte";
     
    	this.AMonthName =	new	Array ("Janvier","Février","Mars","Avril","Mai","Juin","Juillet","Août","Septembre","Octobre","Novembre","Décembre");
    	this.ADayName = (this.AStartAt==0)?new Array ("Dim","Lun","Mar","Mer","Jeu","Ven","Sam"):new Array ("Lun","Mar","Mer","Jeu","Ven","Sam","Dim");
     
    	//Méthodes:	
    	this.MInit = TMInit;
    	this.MPopUpCalendar = TMPopUpCalendar;
    	this.MFormatDate = TMFormatDate;
    	this.MConstructCalendar = TMConstructCalendar;
    	this.MConstructDate = TMConstructDate;
    	this.MWeekNbr = TMWeekNbr;
    	this.MHideCalendar = TMHideCalendar;
    	this.MDecMonth = TMDecMonth;
    	this.MIncMonth = TMIncMonth;
    	this.MShowComment = TMShowComment;
     	this.MShowLegend = TMShowLegend;
    	this.MStartDecMonth = TMStartDecMonth;
    	this.MStartIncMonth = TMStartIncMonth;
    	this.MCloseCalendar = TMCloseCalendar;
    	this.MPopUpMonth = TMPopUpMonth;
    	this.MConstructMonth = TMConstructMonth;
    	this.MPopDownYear = TMPopDownYear;
    	this.MPopDownMonth = TMPopDownMonth;
    	this.MPopUpYear = TMPopUpYear;
    	this.MConstructYear = TMConstructYear;
    	this.MIncYear = TMIncYear;
    	this.MDecYear = TMDecYear;
    	this.MIncYearAuto = TMIncYearAuto;
    	this.MDecYearAuto = TMDecYearAuto;
    	this.MStartDecYear = TMStartDecYear;
    	this.MStartIncYear = TMStartIncYear;
    	this.MSelectYear = TMSelectYear;
    	this.MShowDefault = TMShowDefault;
    	this.MShowScroll = TMShowScroll;
    	this.MShowOpacity = TMShowOpacity;
    	this.MSetXY = TMSetXY;
      	this.MInitWeekDays = TMInitWeekDays;
    	this.MJourFerie = TMJourFerie;
    	this.MGetPaques = TMGetPaques;
     
    	// Initialisation  
      	this.MInit();
    }
     
    function TMInitWeekDays () {
      var i = 0;
      this.ADayCloses.clear(); 
    	while(arguments[i] != null)  
        this.ADayCloses.push(arguments[i++]);
    }
    Merci

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Erreur lors du chargement des class formulaire
    Par erehcab dans le forum Autres composants
    Réponses: 1
    Dernier message: 07/09/2010, 20h09
  2. [AC-2007] Erreur lors du chargement d'un formulaire Access 2007
    Par Lincoln911 dans le forum VBA Access
    Réponses: 2
    Dernier message: 07/04/2010, 17h34
  3. [XHTML] [FORM] problème lors du chargement d'un formulaire
    Par NikoBe dans le forum Balisage (X)HTML et validation W3C
    Réponses: 2
    Dernier message: 04/02/2009, 14h12
  4. Réponses: 2
    Dernier message: 09/03/2008, 18h36
  5. Erreur fatale lors du chargement d'un formulaire
    Par oldergod dans le forum Macros et VBA Excel
    Réponses: 15
    Dernier message: 12/11/2007, 14h33

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo