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 :

getElementById () ne cible pas l'objet


Sujet :

JavaScript

  1. #21
    Rédacteur/Modérateur

    Avatar de SpaceFrog
    Homme Profil pro
    Développeur Web Php Mysql Html Javascript CSS Apache - Intégrateur - Bidouilleur SharePoint
    Inscrit en
    Mars 2002
    Messages
    39 661
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 76
    Localisation : Royaume-Uni

    Informations professionnelles :
    Activité : Développeur Web Php Mysql Html Javascript CSS Apache - Intégrateur - Bidouilleur SharePoint
    Secteur : Industrie

    Informations forums :
    Inscription : Mars 2002
    Messages : 39 661
    Billets dans le blog
    1
    Par défaut
    tu peux nous mettre le html généré ??

    afficher source .. copier / coller
    Ma page Developpez - Mon Blog Developpez
    Président du CCMPTP (Comité Contre le Mot "Problème" dans les Titres de Posts)
    Deux règles du succès: 1) Ne communiquez jamais à quelqu'un tout votre savoir...
    Votre post est résolu ? Alors n'oubliez pas le Tag

    Venez sur le Chat de Développez !

  2. #22
    Rédacteur/Modérateur

    Avatar de SpaceFrog
    Homme Profil pro
    Développeur Web Php Mysql Html Javascript CSS Apache - Intégrateur - Bidouilleur SharePoint
    Inscrit en
    Mars 2002
    Messages
    39 661
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 76
    Localisation : Royaume-Uni

    Informations professionnelles :
    Activité : Développeur Web Php Mysql Html Javascript CSS Apache - Intégrateur - Bidouilleur SharePoint
    Secteur : Industrie

    Informations forums :
    Inscription : Mars 2002
    Messages : 39 661
    Billets dans le blog
    1
    Par défaut
    Tu as pensé à modifier comme ceci ?

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    <script type='text/javascript'>
    function MaxCount(Obj,MaxL){
    		var Texte=Obj.value;
           if(Texte.length > MaxL){
                        Obj.value = Texte.substring(0,MaxL);
                        alert(" Only " + MaxL + " chars");
            				}
            }
    </script>
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    <asp:TextBox ID="tbCommentEmployee" 
                            textmode="MultiLine" Rows="5" runat="server" 
                            onKeyUp="javascript:MaxCount(this,100);" 
                        onChange="javascript:MaxCount(this,100);"></asp:TextBox>
                    </td>
    Ma page Developpez - Mon Blog Developpez
    Président du CCMPTP (Comité Contre le Mot "Problème" dans les Titres de Posts)
    Deux règles du succès: 1) Ne communiquez jamais à quelqu'un tout votre savoir...
    Votre post est résolu ? Alors n'oubliez pas le Tag

    Venez sur le Chat de Développez !

  3. #23
    Membre éclairé
    Homme Profil pro
    Développeur Java
    Inscrit en
    Avril 2007
    Messages
    375
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Loir et Cher (Centre)

    Informations professionnelles :
    Activité : Développeur Java
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Avril 2007
    Messages : 375
    Par défaut
    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
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    <%@ Control Language="C#" ClassName="Employee" AutoEventWireup="true" Src="~/Employee.ascx.cs"
        CodeBehind="Employee.ascx.cs" Inherits="CodeBehindEmployee" %>
     
    <script runat="server">
     
        protected void tbCommentEmployee_TextChanged(object sender, EventArgs e)
        {
            if (tbCommentEmployee.Text.Length >= 100)
                Response.Write("Probleme");
     
        }
    </script>
     
    <script type='text/javascript'>
    function MaxCount(Obj,MaxL){
    		var Texte=Obj.value;
           if(Texte.length > MaxL){
                        Obj.value = Texte.substring(0,MaxL);
                        alert(" Only " + MaxL + " chars");
            				}
            }
    </script>
     
            <table>
                <tr>
                    <td>
                        Birthdate
                    </td>
                    <td>
                        <asp:TextBox ID="tbBirthdate" runat="server" tooltip="dd/mm/yyyy"></asp:TextBox>
                        <asp:ImageButton ID="ImageBirthdate" runat="server" 
                        onclick="ImageBirthdate_Click" src="Images/calendar.jpg" AlternateText="Show Calendar" Width="21px" Height="23px"
                        CausesValidation="False" />
                        <asp:CompareValidator id="checktbBirthdate" runat="server" ErrorMessage="Date format is 'dd/mm/yyyy'" ControlToValidate="tbBirthdate" Type="Date" Operator="DataTypeCheck" display="Dynamic"></asp:CompareValidator>
                        <asp:Calendar ID="CalendarBirthdate" runat="server"  Visible="false"
                            Style="position:absolute; left: 84px; top: 221px; height: 150px; width: 225px;" BackColor="White" 
                            BorderColor="White" BorderWidth="1px" Font-Names="Verdana" Font-Size="9pt" 
                            ForeColor="Black" NextPrevFormat="FullMonth" 
                            onselectionchanged="CalendarBirthdate_SelectionChanged">
                            <SelectedDayStyle BackColor="#333399" ForeColor="White" />
                            <TodayDayStyle BackColor="#CCCCCC" />
                            <OtherMonthDayStyle ForeColor="#999999" />
                            <NextPrevStyle Font-Bold="True" Font-Size="8pt" ForeColor="#333333" 
                                VerticalAlign="Bottom" />
                            <DayHeaderStyle Font-Bold="True" Font-Size="8pt" />
                            <TitleStyle BackColor="White" BorderColor="Black" BorderWidth="4px" 
                                Font-Bold="True" Font-Size="12pt" ForeColor="#333399" />
                        </asp:Calendar>   
                    </td>
                </tr>
                <tr>
                    <td>
                        Nationality
                    </td>
                    <td>
                        <asp:DropDownList ID="ddlNationality" runat="server" DataTextField="Designation_Nationality" DataValueField="IDNationality"></asp:DropDownList>                                  
                        <asp:RequiredFieldValidator ID="checkNationality" runat="server" ErrorMessage="Please select a nationality" 
                            ControlToValidate="ddlNationality" InitialValue="Select the nationality" Display="Dynamic"></asp:RequiredFieldValidator>
                    </td>
                </tr>
                <tr>
                    <td>
                        Address
                    </td>
                    <td>
                        <asp:TextBox ID="tbAddress" runat="server" MaxLength="50"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        ZipCode
                    </td>
                    <td>
                        <asp:TextBox ID="tbZipCode" runat="server"></asp:TextBox>
                        <asp:CompareValidator id="checkZipCode" runat="server" ErrorMessage="Required type is integer" ControlToValidate="tbZipCode" Type="Integer" Operator="DataTypeCheck" display="Dynamic"></asp:CompareValidator>
                    </td>
                </tr>
                <tr>
                    <td>
                        City
                    </td>
                    <td>
                        <asp:TextBox ID="tbCity" runat="server" MaxLength="30"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        Country
                    </td>
                    <td>
                        <asp:DropDownList ID="ddlCountry" runat="server" MaxLength="30"></asp:DropDownList>
                    </td>
                </tr>
                <tr>
                    <td>
                        Personal Phone
                    </td>
                    <td>
                        <asp:TextBox ID="tbPersonalPhone" runat="server"></asp:TextBox>
                        <asp:CompareValidator id="checkPersonalPhone" runat="server" ErrorMessage="Required type is integer" ControlToValidate="tbPersonalPhone" Type="Integer" Operator="DataTypeCheck" display="Dynamic"></asp:CompareValidator>
                    </td>
                </tr>
                <tr>
                    <td>
                        Professional Phone
                    </td>
                    <td>
                        <asp:TextBox ID="tbProfessionalPhone" runat="server"></asp:TextBox>
                        <asp:CompareValidator id="checkProfessionalPhone" runat="server" ErrorMessage="Required type is integer" ControlToValidate="tbProfessionalPhone" Type="Integer" Operator="DataTypeCheck" display="Dynamic"></asp:CompareValidator>
                    </td>
                </tr>
                <tr>
                    <td>
                        Personal Mobile
                    </td>
                    <td>
                        <asp:TextBox ID="tbPersonalMobile" runat="server"></asp:TextBox>
                        <asp:CompareValidator id="checkPersonalMobile" runat="server" ErrorMessage="Required type is integer" ControlToValidate="tbPersonalMobile" Type="Integer" Operator="DataTypeCheck" display="Dynamic"></asp:CompareValidator>
                    </td>
                </tr>
                <tr>
                    <td>
                        Professional Mobile
                    </td>
                    <td>
                        <asp:TextBox ID="tbProfessionalMobile" runat="server"></asp:TextBox>
                        <asp:CompareValidator id="checkProfessionalMobile" runat="server" ErrorMessage="Required type is integer" ControlToValidate="tbProfessionalMobile" Type="Integer" Operator="DataTypeCheck" display="Dynamic"></asp:CompareValidator>
                    </td>
                </tr>
                <tr>
                    <td>
                        Personal Mail
                    </td>
                    <td>
                        <asp:TextBox ID="tbPersonalMail" runat="server" MaxLength="50"></asp:TextBox>
                        <asp:RegularExpressionValidator id="checkPersonnalEmail" ControlToValidate="tbPersonalMail"
                            Text="Invalid email" 
                    ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*" 
                    Runat="server" style = "position : relative" > </asp:RegularExpressionValidator>
                 </td>
                </tr>
                <tr>
                    <td>
                        Professional Mail
                    </td>
                    <td>
                        <asp:TextBox ID="tbProfessionalMail" runat="server" MaxLength="50"></asp:TextBox>
                        <asp:RegularExpressionValidator id="checkProfessionalEmail" ControlToValidate="tbProfessionalMail"
                            Text="Invalid email" 
                    ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*" 
                    Runat="server" style = "position : relative" > </asp:RegularExpressionValidator>
                 </td>
     
                </tr>
                <tr>
                    <td>
                        Phone Extension
                    </td>
                    <td>
                        <asp:TextBox ID="tbPhoneExtension" runat="server"></asp:TextBox>
                        <asp:CompareValidator id="checkPhoneExtension" runat="server" ErrorMessage="Required type is integer" ControlToValidate="tbPhoneExtension" Type="Integer" Operator="DataTypeCheck" display="Dynamic"></asp:CompareValidator>
                    </td>
                </tr>
                <tr>
                    <td>
                        Transportation Mode
                    </td>
                    <td>
                        <asp:ListBox ID="lbxTransportation" runat="server"></asp:ListBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        Business Unit
                    </td>
                    <td>
                        <asp:DropDownList ID="ddlBusinessUnit" runat="server" DataTextField="DesignationBU" DataValueField="idBusinessUnit">
                        </asp:DropDownList>
                        <asp:RequiredFieldValidator ID="checkBusinessUnit" runat="server" ErrorMessage="Please select a business unit" 
                            ControlToValidate="ddlBusinessUnit" InitialValue="Select the business unit" Display="Dynamic"></asp:RequiredFieldValidator>
                    </td>
                </tr>
                <tr>
                    <td>
                        Manager
                    </td>
                    <td>
                        <asp:DropDownList ID="ddlManager" runat="server">
                        </asp:DropDownList>
     
                    </td>
                </tr>
                <tr>
                    <td>
                        Manager RI
                    </td>
                    <td>
                        <asp:DropDownList ID="ddlManagerRI" runat="server">
                        </asp:DropDownList>
     
                    </td>
                </tr>
                <tr>
                    <td>
                        Manager RC
                    </td>
                    <td>
                        <asp:DropDownList ID="ddlManagerRC" runat="server">
                        </asp:DropDownList>
     
                    </td>
                </tr>
                <tr>
                    <td>
                        Contract Type
                    </td>
                    <td>
                        <asp:DropDownList ID="ddlContractType" runat="server" DataTextField="Type_contract" DataValueField="IDtype_contract">
                        </asp:DropDownList>
                        <asp:RequiredFieldValidator ID="checkContractType" runat="server" ErrorMessage="Please select a type of contract" 
                                ControlToValidate="ddlContractType" InitialValue="Select the type of contract" Display="Dynamic"></asp:RequiredFieldValidator>
                    </td>
                </tr>
                <tr>
                    <td>
                        Code Gestoria
                    </td>
                    <td>
                        <asp:TextBox ID="tbCodeGestoria" runat="server"></asp:TextBox>
                        <asp:CompareValidator id="checkCodeGestoria" runat="server" ErrorMessage="Required type is integer" ControlToValidate="tbCodeGestoria" Type="Integer" Operator="DataTypeCheck" display="Dynamic"></asp:CompareValidator>
                        <asp:RequiredFieldValidator ID="requiredCodeGestoria" runat="server" ErrorMessage="Field Required" 
                            ControlToValidate="tbCodeGestoria" Display="Dynamic"></asp:RequiredFieldValidator>
                    </td>
                </tr>
                <tr>
                    <td>
                        Start Date
                    </td>
                    <td>
                        <asp:TextBox ID="tbStartDate" runat="server" MaxLength="11" tooltip="dd/mm/yyyy"></asp:TextBox>
                        <asp:ImageButton ID="ImageCalendarStartDate" runat="server" 
                            onclick="ImageCalendarStartDate_Click" src="Images/calendar.jpg" AlternateText="Show Calendar" Width="21px" Height="23px"
                            CausesValidation="False" />
                        <asp:CompareValidator id="checkStartDate" runat="server" ErrorMessage="Date format is 'dd/mm/yyyy'" ControlToValidate="tbStartDate" Type="Date" Operator="DataTypeCheck" display="Dynamic"></asp:CompareValidator>
                        <asp:Calendar ID="CalendarStartDate" runat="server"  Visible="false"
     
     
                            Style="position:absolute; left: 172px; top: 563px; height: 150px; width: 225px;" BackColor="White" 
                            BorderColor="White" BorderWidth="1px" Font-Names="Verdana" Font-Size="9pt" 
                            ForeColor="Black" NextPrevFormat="FullMonth" 
                            onselectionchanged="CalendarStartDate_SelectionChanged">
                            <SelectedDayStyle BackColor="#333399" ForeColor="White" />
                            <TodayDayStyle BackColor="#CCCCCC" />
                            <OtherMonthDayStyle ForeColor="#999999" />
                            <NextPrevStyle Font-Bold="True" Font-Size="8pt" ForeColor="#333333" 
                                VerticalAlign="Bottom" />
                            <DayHeaderStyle Font-Bold="True" Font-Size="8pt" />
                            <TitleStyle BackColor="White" BorderColor="Black" BorderWidth="4px" 
                                Font-Bold="True" Font-Size="12pt" ForeColor="#333399" />
                        </asp:Calendar>            
                    </td>
                </tr>
                <tr>
                    <td>
                        Comment Employee
                    </td>
                    <td>
                        <asp:TextBox ID="tbCommentEmployee" 
                            textmode="MultiLine" Rows="5" runat="server" 
                            onKeyUp="javascript:MaxCount('tbCommentEmployee',100);" 
                        onChange="javascript:MaxCount('tbCommentEmployee',100);"></asp:TextBox>
                    </td>
                </tr>
            </table>

Discussions similaires

  1. a la valeur Null ou n'est pas un objet et getElementById
    Par adroussel dans le forum Général JavaScript
    Réponses: 12
    Dernier message: 13/01/2010, 01h22
  2. Document.form... n'est pas un objet
    Par mcbrett dans le forum Général JavaScript
    Réponses: 4
    Dernier message: 25/01/2006, 09h38
  3. Réponses: 2
    Dernier message: 07/09/2005, 09h55
  4. librairie introuvable! Erreur"Pas d'objet dans ce contr
    Par vins111282 dans le forum Access
    Réponses: 5
    Dernier message: 16/05/2005, 14h07

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