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 :

Case a cocher select all et PHP avec form variable


Sujet :

JavaScript

  1. #1
    Nouveau membre du Club
    Profil pro
    Inscrit en
    Mars 2010
    Messages
    54
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mars 2010
    Messages : 54
    Points : 26
    Points
    26
    Par défaut Case a cocher select all et PHP avec form variable
    Bonjour à tous,
    Voici mon problème avec le même formulaire je génère 3 formulaire en php
    1er Php
    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
    if($base=="1")
    			{
    			$text="sale flash";
    			$ext="vf";
    			}
    		if($base=="2")
    			{
    			$text="Coutant Price";
    			$ext="cp";
    			}
    		if($base=="3")
    			{
    			$text="Reduction of Stocks";
    			$ext="rs";
    			}
    Javascript:

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    <script language = "javascript">			
    		 function CheckAllID()
    			{
                 for (var i=0;i<document.form'.$ext.'.elements.length;i++)
                 {
                     var x = document.form'.$ext.'.elements[i];
                     if (x.name == "'.$ext.'[]")
                     {
                         x.checked = document.form'.$ext.'.selall.checked;
                     }
                 }
             }	         
     
            </script
    Php:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
     <form action="'.$_SERVER['REQUEST_URI'].'" method="post" id="form'.$ext.'" name="form'.$ext.'">
    <input type=checkbox name="selall" onClick="CheckAllID()">
    <INPUT TYPE=checkbox VALUE="'.$aux[1].'" NAME="'.$ext.'[]">
    Mon problème:
    -lorsque je clique rien ne se passe par contre si je remplace '.$ext.' par la valeur vf ca fonctionne c'est avec la variable php qu'il ne veut pas et je ne sais comment faire???

    Merci d'avance

  2. #2
    Expert confirmé
    Avatar de le_chomeur
    Profil pro
    Développeur informatique
    Inscrit en
    Février 2006
    Messages
    3 653
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations professionnelles :
    Activité : Développeur informatique

    Informations forums :
    Inscription : Février 2006
    Messages : 3 653
    Points : 4 835
    Points
    4 835
    Par défaut
    dans ton code javascript , les variable sont elles bien générées ??
    car a ce que je vois tu mêle js et php sans ouvirir de balise php ...

    montre nous le code généré

  3. #3
    Nouveau membre du Club
    Profil pro
    Inscrit en
    Mars 2010
    Messages
    54
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mars 2010
    Messages : 54
    Points : 26
    Points
    26
    Par défaut
    Voici le code généré:
    Javascript

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    <script language = "javascript">			
    		function CheckAllID()
    			{
                 for (var i=0;i<document.formrs.elements.length;i++)
                 {
                     var x = document.formrs.elements[i];
                     if (x.name == "rs[]")
                     {
                         x.checked = document.formrs.selall.checked;
                     }
                 }
             }	          
     
            </script>



    Php form

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    <form action="/PrestaShop2/administrator/index.php?tab=AdminModules&configure=venteflash&token=d1a30c744a3e810ec48d2b5b7ceebfc5" method="post" id="formrs" name="formrs">
     
     
    <td width="10" align="left" style="vertical-align: top;"><input type=checkbox name="selall" onClick="CheckAllID()"></td>

    Php input


    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    <INPUT TYPE=checkbox VALUE="8" NAME="rs[]">

  4. #4
    Expert confirmé
    Avatar de le_chomeur
    Profil pro
    Développeur informatique
    Inscrit en
    Février 2006
    Messages
    3 653
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations professionnelles :
    Activité : Développeur informatique

    Informations forums :
    Inscription : Février 2006
    Messages : 3 653
    Points : 4 835
    Points
    4 835
    Par défaut
    essaye plutôt :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    function CheckAllID()
    		{
    			var listInput = document.getElementsByTagName('input');
    			var isChecked = document.getElementById('selall').checked;
    			for (var i=0 , l =listInput.length ; i <l ;i++)
    			{
     
    				if (listInput[i].type == 'checkbox' && listInput[i].name == "rs[]")
    				{
    					listInput[i].checked = isChecked;
    				}
    			}
    		}

  5. #5
    Nouveau membre du Club
    Profil pro
    Inscrit en
    Mars 2010
    Messages
    54
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mars 2010
    Messages : 54
    Points : 26
    Points
    26
    Par défaut
    Sniff ca ne change rien
    Php

    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
     
    $this->_html .='
             <script language = "javascript">			
    		 function CheckAllID()
    		{
    			var listInput = document.getElementsByTagName(\'input\');
    			var isChecked = document.getElementById(\'selall\').checked;
    			for (var i=0 , l =listInput.length ; i <l ;i++)
    			{
     
    				if (listInput[i].type == \'checkbox\' && listInput[i].name == "'.$ext.'[]")
    				{
    					listInput[i].checked = isChecked;
    				}
    			}
    		}		 
            </script>';
    afficher:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
     
    function CheckAllID()
    		{
    			var listInput = document.getElementsByTagName('input');
    			var isChecked = document.getElementById('selall').checked;
    			for (var i=0 , l =listInput.length ; i <l ;i++)
    			{
     
    				if (listInput[i].type == 'checkbox' && listInput[i].name == "rs[]")
    				{
    					listInput[i].checked = isChecked;
    				}
    			}
    		}

  6. #6
    Expert éminent sénior

    Avatar de vermine
    Profil pro
    Inscrit en
    Mars 2008
    Messages
    6 582
    Détails du profil
    Informations personnelles :
    Âge : 39
    Localisation : Belgique

    Informations forums :
    Inscription : Mars 2008
    Messages : 6 582
    Points : 79 912
    Points
    79 912
    Par défaut
    Bonjour,

    La chose qui me saute aux yeux même si ce n'est sans doute pas ça (mais bon, à comprendre quand même), c'est que vous n'avez pas d'id sur votre:

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
    <input type=checkbox name="selall" onClick="CheckAllID()">
    Or, le Chomeur vous propose la méthode getElementById() qui comme son nom l'indique, demande un id (même si IE cherchera également sur le name):

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
    var isChecked = document.getElementById('selall').checked;

  7. #7
    Nouveau membre du Club
    Profil pro
    Inscrit en
    Mars 2010
    Messages
    54
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mars 2010
    Messages : 54
    Points : 26
    Points
    26
    Par défaut
    J'ai pas compris ou rajouter le var ??

    Et je dois mettre quoi a la place du on click ???

  8. #8
    Expert éminent sénior

    Avatar de vermine
    Profil pro
    Inscrit en
    Mars 2008
    Messages
    6 582
    Détails du profil
    Informations personnelles :
    Âge : 39
    Localisation : Belgique

    Informations forums :
    Inscription : Mars 2008
    Messages : 6 582
    Points : 79 912
    Points
    79 912
    Par défaut
    La déclaration de la variable isChecked est dans la fonction CheckAllID. Donc vous laissez le onclick comme il est.
    Mais vous rajoutez un id sur votre input:

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
    <input type=checkbox name="selall" id="selall" onClick="CheckAllID()">

  9. #9
    Expert confirmé
    Avatar de le_chomeur
    Profil pro
    Développeur informatique
    Inscrit en
    Février 2006
    Messages
    3 653
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations professionnelles :
    Activité : Développeur informatique

    Informations forums :
    Inscription : Février 2006
    Messages : 3 653
    Points : 4 835
    Points
    4 835
    Par défaut
    autant pour moi effectivement

    version modifié sans id :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
     
    function CheckAllID(checkAll)
    		{
    			var listInput = document.getElementsByTagName('input');
    			var isChecked = checkAll.checked;
    			for (var i=0 , l =listInput.length ; i <l ;i++)
    			{
     
    				if (listInput[i].type == 'checkbox' && listInput[i].name == "rs[]")
    				{
    					listInput[i].checked = isChecked;
    				}
    			}
    		}
    et sur l'appel de ma méthode :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    <input type=checkbox name="selall" onClick="CheckAllID(this)"


    ou juste rajouter un id comme proposé par vermine

  10. #10
    Nouveau membre du Club
    Profil pro
    Inscrit en
    Mars 2010
    Messages
    54
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mars 2010
    Messages : 54
    Points : 26
    Points
    26
    Par défaut
    J'ai essayer les 2 versions mais rien ni fait.
    Je ne comprend pas pourquoi
    Par contre je charge les pages en jquery
    Alors je ne sais pas si ca fait un conflit

    Function qui permet de voir les fonction
    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
     
    function getVentesFlash($base)
         {
     
    		if($base=="1")
    			{
    			$text="sale flash";
    			$ext="vf";
    			}
    		if($base=="2")
    			{
    			$text="Coutant Price";
    			$ext="cp";
    			}
    		if($base=="3")
    			{
    			$text="Reduction of Stocks";
    			$ext="rs";
    			}	
     
             global $cookie;
             $id_lang = $cookie->id_lang;
             $sql = Db::getInstance()->Execute('
             SELECT vf.*, cl.name FROM `'._DB_PREFIX_.'product` p
    		 LEFT JOIN `'._DB_PREFIX_.'venteflash` vf ON vf.`id_venteflash` = p.`id_product`
    		 LEFT JOIN `'._DB_PREFIX_.'category_lang` cl ON cl.`id_category` = p.`id_category_default` AND  cl.id_lang='.($id_lang).'
    		WHERE p.`id_product` = vf.`id_venteflash` AND vf.typesale='.$base.'
             ORDER BY id_category_default DESC
             ');
     
             $nb_comments = mysql_num_rows($sql);
    		 if($base=="1")
    			{
    			 $this->_html .='
             <script language = "javascript">			
    		 function CheckAllID()
    			{
                 for (var i=0;i<document.vf.elements.length;i++)
                 {
                     var x = document.vf.elements[i];
                     if (x.name == "vf[]")
                     {
                         x.checked = document.vf.selall.checked;
                     }
                 }
             }	         
     
            </script>';
    		$this->_html .= '<br /> <form action="'.$_SERVER['REQUEST_URI'].'" method="post" id="vf" name="vf">';
    			}
    		if($base=="2")
    			{
    			 $this->_html .='
             <script language = "javascript">			
    		function CheckAllID()
    			{
                 for (var i=0;i<document.cp.elements.length;i++)
                 {
                     var x = document.cp.elements[i];
                     if (x.name == "cp[]")
                     {
                         x.checked = document.cp.selall.checked;
                     }
                 }
             }	        
     
     
            </script>';
    		$this->_html .= '<br /> <form action="'.$_SERVER['REQUEST_URI'].'" method="post" id="formcp" name="formcp">';
    			}
    		if($base=="3")
    			{
    			 $this->_html .='
             <script language = "javascript">			
    		 function CheckAllID()
    			{
                 for (var i=0;i<document.formrs.elements.length;i++)
                 {
                     var x = document.formrs.elements[i];
                     if (x.name == "rs[]")
                     {
                         x.checked = document.formrs.selall.checked;
                     }
                 }
             }	         
     
            </script>';
    		$this->_html .= '<br /> <form action="'.$_SERVER['REQUEST_URI'].'" method="post" id="formrs" name="formrs">';
    			}	
     
     
     
                $this->_html .= '   <fieldset>
                       <legend><img src="../modules/venteflash/logo.gif" />';
    				   if($ext==vf)
    				   $this->_html .= ''.$this->l('Produced to put  Flash Sale').'';
    				    if($ext==cp)
    				   $this->_html .= ''.$this->l('Produced to put Coutant Price').'';
    				    if($ext==rs)
    				   $this->_html .= ''.$this->l('Produced to put Reduction of Stocks').'';
    				   $this->_html .= '</legend>';
             if ($nb_comments == '0')
             {
                 $this->_html .= '<div style="font-size:15px;color: red;text-align: left">';
    				   if($ext==vf)
    				   $this->_html .= ''.$this->l('No Flash Sale for the time being.').'';
    				    if($ext==cp)
    				   $this->_html .= ''.$this->l('No Coutant Price for the time being.').'';
    				   if($ext==rs)
    				   $this->_html .= ''.$this->l('No Reduction of Stocks for the time being.').'';
    				   $this->_html .= '</div>';
             }
             else
             {
     
                  $this->_html .= '
                 <table  class="table" border="0" width="800" cellpadding="0" cellspacing="2" id="form'.$ext.'">
                 <tr>
                     <td width="10" align="left" style="vertical-align: top;"><input type=checkbox name="selall" onClick="CheckAllID()" id="selall"></td>
                     <td colspan="6" style="color: blue;"><b>'.$this->l('Select/Deselect all').'</b></td>
                 </tr>
                 <tr>
                     <td style="color:green;vertical-align: top;font-weight:bold;text-align: left">---</td>
                     <td style="color:green;vertical-align: top;font-weight:bold;text-align: left">'.$this->l('ID').'</td>               
                     <td width="280" style="color:green;vertical-align: top;font-weight:bold;text-align: left">'.$this->l('Product Name').'</td>
                     <td style="color:green;vertical-align: top;font-weight:bold;text-align: left">'.$this->l('Date/Time From').'</td>
                     <td style="color:green;vertical-align: top;font-weight:bold;text-align: left">'.$this->l('Date/Time To').'</td>
                     <td style="color:green;vertical-align: top;font-weight:bold;text-align: center;">'.$this->l('Reduction').'</td>
                     <td style="color:green;vertical-align: top;font-weight:bold;text-align: center;">'.$this->l('Status').'</td>
                 </tr>
                 ';
                 while ($aux = mysql_fetch_row($sql))
                 {
    			 $nb_comments = mysql_num_rows($sql);
    			 if($aux[7] != $nomcat)
    				{
    				$nomcat=$aux[7];
    				$this->_html .='
                 <tr>		
    			 <td bgcolor="#CECECE" style="color:#FF1723;font-weight:bold;vertical-align:top;text-align:center;" colspan="7" ><nobr>'.($nomcat).'</nobr><td><tr>';			 
    				}
     
                     $this->_html .='
                 <tr>
                 <td style="vertical-align: top;text-align: left"><INPUT TYPE=checkbox VALUE="'.$aux[1].'" name="'.$ext.'[]"></td>
                 <td style="color:#8B0000;font-weight:bold;vertical-align: top;text-align: left"><a href="#" title="'.$this->l('Click!').'" onclick="document.getElementById(\''.$ext.'product\').value=\''.$aux[1].'\'">'.$aux[1].'</a></td>            
                 <td width="280" style="color:#191970;font-weight:bold;vertical-align: top;text-align: left">'.$this->showproductname($aux[1],$id_lang).'</td>
                 <td style="color:#8B0A50;font-weight:bold;vertical-align: top;text-align: left">'.$aux[2].'</td>
                 <td style="color:#000000;font-weight:bold;vertical-align: top;text-align: left">'.$aux[3].'</td>
                 <td style="color:#8B008B;font-weight:bold;vertical-align: top;text-align: center">'.$aux[4].'%</td>
                 <td style="vertical-align: top;text-align: center">'.$this->statusVenteFlash($aux[1],$aux[4],$base).'</td>
                 </tr>
                 ';
                 }
                 $this->_html .='
                 <tr>
                    <td style="text-align: right" colspan="4"><input class="button" name="start'.$ext.'" value= "'.$this->l('Start').'" type="submit" style="color:green;font-weight:bold;width: 165px;"/></td>
                    <td style="text-align: right" ><input class="button" name="stop'.$ext.'" value= "'.$this->l('Stop').'" type="submit" style="color:orange;font-weight:bold;width: 165px;"/></td>
                    <td style="text-align: right" colspan="2"><input class="button" name="del'.$ext.'" value= "'.$this->l('Delete').'" type="submit" style="color:red;font-weight:bold;width: 165px;"/></td>
                </tr>
              </table> <br />';}
               $this->_html .='
                 <table class="table" border="0" width="800" cellpadding="0" cellspacing="2" id="10">
            <tr>
               <td style="color:blue; vertical-align: top;"><b>'.$this->l('Product').'</b></td>
               <td style="color:blue; vertical-align: top;"><b>'.$this->l('Id').'</b></td>
               <td style="color:blue; vertical-align: top;"><b>'.$this->l('Date/Time From').'</b></td>
               <td style="color:blue; vertical-align: top;"><b>'.$this->l('Date/Time To').'</b></td>
               <td style="color:blue; vertical-align: top;"><b>'.$this->l('Reduction (%)').'</b></td>
            </tr>
            <tr>
               <td style="color:blue; vertical-align: top;"><input style="width: 200px" type="text" id="'.$ext.'productinput" value="" /></td>
               <td style="color:blue; vertical-align: top;"><input type="text" name="'.$ext.'_product" id="'.$ext.'product" value="" style="font-size: 10px; width: 20px;" /></td>
               <td style="color:blue; vertical-align: top;"><input type="text" id="'.$ext.'_from" name="'.$ext.'_from" value="'.(date('Y-m-d H:i:s')).'" style="width: 150px;"/>
                 <a href="javascript:NewCssCal(\''.$ext.'_from\',\'yyyymmdd\',\'arrow\',true,24,false)"><img src="'.__PS_BASE_URI__.'modules/venteflash/images/cal.gif" width="16" height="16" alt="'.$this->l('Pick a date').'"></a></td>
               <td style="color:blue; vertical-align: top;"><input type="text" id="'.$ext.'_to" name="'.$ext.'_to"   value="'.(date('Y-m-d H:i:s')).'" style="width: 150px;"/>
                 <a href="javascript:NewCssCal(\''.$ext.'_to\',\'yyyymmdd\',\'arrow\',true,24,false)"><img src="'.__PS_BASE_URI__.'modules/venteflash/images/cal.gif" width="16" height="16" alt="'.$this->l('Pick a date').'"></a></td>
               <td style="color:blue; vertical-align: top;"><input type="text" MAXLENGTH="2" name="'.$ext.'_reduction" value="" style="width: 100px;"/></td>
            </tr>
            <tr>
               <td align="right" colspan="5"><input class="button" name="addSubmit" value= "'.$this->l('Add').'" type="submit" style="color:blue;font-weight:bold;width: 180px;" onClick="javascript: submitform()"/></td></tr>
            </table>
                  <script language="JavaScript">
                  var options = {
    		      script:"'.__PS_BASE_URI__.'modules/venteflash/productsuggest.php?json=true&limit=6&",
    		      varname:"input",
    		      json:true,
    		      shownoresults:true,
    		      maxresults:15,
    		      callback: function (obj) { document.getElementById(\''.$ext.'product\').value = obj.id; }
    	        };
    	          var as_json = new bsn.AutoSuggest(\''.$ext.'productinput\', options);
                 </script>
                  </fieldset></form>
     
                 ';
     
         }
    L'affichage du menu

    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
     
    public function getContent()
        {
    		$this->_html .= ' 
    <script type="text/javascript" src="'.__PS_BASE_URI__.'modules/venteflash/js/jquery.js"></script>		
     
    	<style type="text/css">  
    #flowtabs {
     
    	width:900px;
    	height:40px !important;
    	margin:0 !important; 
    	padding:0;	
     
    	margin-bottom:-2px;
    }
     
    #flowtabs li { 
    	float:left; 
    	margin:0; 
    	padding:0; 
    	text-indent:0; 
    	list-style-type:none;
    }
     
    #flowtabs li a {
    	background: #dddddd url("'.$this->_path.'images/tab.png") no-repeat 0 -80px;
    	display:block;
    	height: 40px;   
    	width: 100px; 	
    	padding:0px 10px;
    	margin:0px;
     
    	/* font decoration */
    	color:#000;
    	font-size:12px;
    	line-height:33px;
    	text-align:left;
    	text-decoration:none;
    }
     
    #flowtabs li a img.img_lang {
    	margin-top: -2px;
    	margin-right: 5px;
    }
     
     
    #flowtabs a.tab_on {
    	background-color: #DDFFAA;
    }
     
    #flowtabs a.tab_general {
    	background-color: #FFF6D3;
    }
     
    #flowtabs a.tab_lang_default {
    	background-color: #D1EAEF;
    }
     
     
    #flowtabs a:hover {
    	background-position: 0 -40px;
    }
     
    #flowtabs a.current {
    	background-position: 0 0 !important;
    	cursor:default;
    	font-weight: bold;
    }
     
    #flowpanes {
    	background: #fffff0 none;		
    	width:898px;
    	border: 1px solid #999;
    	border-top: none;
    }
     
    #flowpanes .flowpanes_content {	
    	color:#000;	
    	margin:20px 14px;
    }
     
    #flowpanes div h2 {
    	font-weight:normal;
    	letter-spacing:1px;
    	margin:10px 0 0 0;
    	font-size:22px;	
    }
     
    #flowpanes a {	
    	font-size:14px;
    }
     
     
    #flowpanes div.narrow {
    	padding-right:120px;		
    }
     
    .tab_void {
    	margin-top: 3px;
    	height: 35px;
    	background-color: #F4F4F4;
    	border-top: 1px solid #999;
    	border-right: 1px solid #999;
    	border-bottom: 1px solid #999;
    }
     
    #content_tabs{
    margin-left: 14px;
     
    }
    </style>
    	  ';
     
    if ($_POST)
            {
                $this->_postValidation();
    			if (!sizeof($this->_postErrors))
    				$this->_postProcess();
    			else
    				foreach ($this->_postErrors AS $err)
    					$this->_html .= '<div class="alert error">'. $err .'</div>';
     	    }		
    $this->_html .= '<h2>'.$this->displayName.'</h2><br>'; 		
    	  $this->_html .= ' 
     
    	 <div id="content_tabs">
    	<ul  id="flowtabs">
    	<li ><a href="#" title="General" class="tab_general" >'.$this->l('General').'</a></li> 
    	<li ><a href="#" title="Category" class="tab_on tab_lang_default" >'.$this->l('Category').'</a></li> 
    	 <li ><a href="#" title="Flash" class="tab_on " >'.$this->l('Flash Sales').'</a></li>     
          <li><a href="#" title="Countant" class="tab_on " >'.$this->l('Coutant Price').'</a></li>     
    	  <li ><a href="#" title="stocks" class="tab_on " >'.$this->l('clearance').'</a></li>
          <li ><a href="#" title="Promotion" class="tab_on " >'.$this->l('Promotion').'</a></li>     
          <li ><a href="#" title="Sale" class="tab_on " >'.$this->l('On sale !').'</a></li>
          <li ><div class="tab_void"></div></li>	  
    	  </ul>
     
     
     
    	  ';
     
    		$this->_html .= ' <script type="text/javascript" src="'.__PS_BASE_URI__.'modules/venteflash/js/datetimepicker_css.js"></script>';		
            $this->_html .= ' <script type="text/javascript" src="'.__PS_BASE_URI__.'modules/venteflash/js/bsn.AutoSuggest_2.1.3.js" charset="utf-8"></script>';
            $this->_html .= ' <link rel="stylesheet" href="'.__PS_BASE_URI__.'modules/venteflash/css/autosuggest_inquisitor.css" type="text/css" media="screen" charset="utf-8" />';
     
    		$this->_html .= '
    		<div id="flowpanes"> 
    		<br clear="all"> 
    		<div class="flowpanes_content"  id="General">';
     
    		$this->_displayForm();
    		$this->_html .= '</div>';
     
    		$this->_html .= '<div class="flowpanes_content"  id="Category">';		
    		 $this->_displayCategoryPrice();
              $this->showCategories();         
     
    		  $this->_html .= '</div>';
     
    		$this->_html .= '<div class="flowpanes_content"  id="Flash">';	
            $this->startVenteFlash();
            $this->checkVF();               
              $this->_displayVenteflash();
              $this->getVentesFlash(1);          
     
    		  $this->_html .= '</div>';
     
    		$this->_html .= '<div class="flowpanes_content"  id="Countant">';	
            $this->startVenteFlash();
            $this->checkVF();             
              $this->_displayCoutantPrice();
               $this->getVentesFlash(2);            
     
    		  $this->_html .= '</div>';
     
    		$this->_html .= '<div class="flowpanes_content"  id="stocks">';	
            $this->startVenteFlash();
            $this->checkVF();            
              $this->_displayreductionofstocks();
               $this->getVentesFlash(3);            
     
    		  $this->_html .= '</div>';
     
    		$this->_html .= '<div class="flowpanes_content"  id="Promotion">';	
            $this->_displayReduction();
              $this->getReduction("Promotion");         
     
    		 $this->_html .= '</div>';
     
    		$this->_html .= '<div class="flowpanes_content" id="Sale">';	
            $this->_displayReduction();          
              $this->getReduction("On sale !"); 
     
    		  $this->_html .= '</div></div>';
     
    	 $this->_html .= '<script type="text/javascript"> 
    	$(function() {
     $("#flowtabs").tabs("#flowpanes > div").history();
    });</script> </div>';
    		return $this->_html;
     
     
    	}

    J'ai tout mis au cas ou il y a un conflit
    Merci de votre aide

  11. #11
    Expert confirmé
    Avatar de le_chomeur
    Profil pro
    Développeur informatique
    Inscrit en
    Février 2006
    Messages
    3 653
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations professionnelles :
    Activité : Développeur informatique

    Informations forums :
    Inscription : Février 2006
    Messages : 3 653
    Points : 4 835
    Points
    4 835
    Par défaut
    On veut le code généré !

  12. #12
    Nouveau membre du Club
    Profil pro
    Inscrit en
    Mars 2010
    Messages
    54
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mars 2010
    Messages : 54
    Points : 26
    Points
    26
    Par défaut
    Trouver
    function CheckAllID()
    portait tous les 5 le même nom et vue que l'on ne recharge pas la page ca bug

    Pour corriger
    function Check'.$ext.'AllID()

    Et pareil dans onclick merci à tous de m'avoir mis sur la voie

  13. #13
    Expert éminent sénior

    Avatar de vermine
    Profil pro
    Inscrit en
    Mars 2008
    Messages
    6 582
    Détails du profil
    Informations personnelles :
    Âge : 39
    Localisation : Belgique

    Informations forums :
    Inscription : Mars 2008
    Messages : 6 582
    Points : 79 912
    Points
    79 912
    Par défaut
    Ha d'accord. C'est parfait d'avoir trouvé tout seul.
    En fait, Javascript n'a pris en compte que la dernière version de CheckAllID(). Il a simplement redéfinit l'objet de ce nom-là selon la chronologie de son parsing.

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

Discussions similaires

  1. exec php avec des variables
    Par sam_owm dans le forum EDI, CMS, Outils, Scripts et API
    Réponses: 4
    Dernier message: 10/12/2008, 16h34
  2. Selection d'une plage avec ligne variable
    Par ginkas31 dans le forum Macros et VBA Excel
    Réponses: 2
    Dernier message: 10/01/2008, 07h04
  3. select dans SQL dynamique avec table variable
    Par enzodb2 dans le forum DB2
    Réponses: 4
    Dernier message: 26/07/2007, 16h28
  4. Réponses: 2
    Dernier message: 21/07/2006, 12h28
  5. Comment creer un choix multiple avec des cases a cocher ??
    Par pedrosystem dans le forum Access
    Réponses: 5
    Dernier message: 09/03/2006, 10h36

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