Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

[quickform et smarty] Probleme d'affichage

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Language: French
View previous topic :: View next topic  
Author Message
dawei
Smarty Rookie


Joined: 14 Dec 2006
Posts: 11

PostPosted: Tue Jan 02, 2007 3:41 pm    Post subject: [quickform et smarty] Probleme d'affichage Reply with quote

dans la partie php:
Code:


//affectation de tous les elements de personne(client) dans un tableau
   $tableau_personne= Array();
   $tableau_personne = 'var tableau = Array();';
   foreach($tab_personne_tous as $element){
      $tableau_personne .='tableau['.$element['no'].'] ={"nom": \''.$element['nom'].'\',"prenom":\''.$element['prenom'].'\'};';
   }
   $smarty->assign('tab_personne',$tableau_personne);
   


//affectation de tous les elements de personne2(sous-client) dans un tableau
   $tableau_personne2= Array();
   //var_dump($tab_personne2_tous);
   $tableau_personne = 'var tableau2 = Array();';
   foreach($tab_personne2_tous as $element){
      $tableau_personne .='tableau['.$element['no'].'] ={"nom": \''.$element['nom'].'\',"prenom":\''.$element['prenom'].'\'};';
   }
   $smarty->assign('tab_personne2',$tableau_personne2);



Dans la partie template:
Code:


{literal}
<script type="text/javascript">
// pour le tableau personne1
   function verifPseudo(noclient){
      {/literal}
         {$tab_personne}
      {literal}
      document.forms['editer_client'].elements['nom_personne'].value=tableau[noclient]['nom'];
      document.forms['editer_client'].elements['prenom_personne'].value=tableau[noclient]['prenom'];
      }
   
function verifPseudo2(nosociete){
      {/literal}
         {$tab_personne2}
      {literal}
      alert(tableau2[no]['nom']);   document.forms['editer_client'].elements['nom_societe'].value=tableau2[nosociete]['nom'];
   }
</script>
{/literal}


Avec un seul tableau, il n'y a pas de probleme mais avec 2, vive les degats. Le formulaire ne fonctionne plus

Merci
_________________
/\_ Le forum est là lorsqu'on a besoin d'aide. _/\
Back to top
View user's profile Send private message
ciboulette
Smarty Regular


Joined: 13 Jul 2006
Posts: 45

PostPosted: Tue Jan 02, 2007 10:17 pm    Post subject: Reply with quote

pas j'ai pas compris se que doit faire ton code de base Smile
Back to top
View user's profile Send private message
dawei
Smarty Rookie


Joined: 14 Dec 2006
Posts: 11

PostPosted: Thu Jan 25, 2007 12:08 pm    Post subject: Reply with quote

bonjour,

ce que je voulais faire, c'etait de generer plusieur tableau et recuperer dans la template le reultat du tableau

Probleme réglé, enfin!
_________________
/\_ Le forum est là lorsqu'on a besoin d'aide. _/\
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Language: French All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP