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

Utilisation de {html_options}

 
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
isavdz
Smarty n00b


Joined: 01 Sep 2009
Posts: 2

PostPosted: Tue Sep 01, 2009 1:16 pm    Post subject: Utilisation de {html_options} Reply with quote

Bonjour,

J'ai un formulaire de 'filtrage/recherche' avec un select dont voici le code :
Code:

<select name="agd_type_id">
       <option>{dict id='par_type' edit=false}Par type{/dict}</option>
       {html_options options=$agenda_types selected=$smarty.session.agenda_search.agd_type_id}
</select>


Ceci marche très bien.
Voici ce que j'obtiens :
Code:

<select name="agd_type_id">
     <option>Par type</option>
     <option label="Expositions" value="1">Expositions</option>
     <option label="Manifestations culturelles" value="2">Manifestations culturelles</option>
     <option label="Foires, Marchés, Salons" value="3">Foires, Marchés, Salons</option>
     <option label="Manifestations sportives" value="4">Manifestations sportives</option>
     <option label="Musique, Concerts" value="6">Musique, Concerts</option>
     <option label="Stages &amp; Ateliers" value="7">Stages &amp; Ateliers</option>
     <option label="Lotos" value="8">Lotos</option>
     <option label="Puciers, Brocantes, Vide-greniers" value="9">Puciers, Brocantes, Vide-greniers</option>
     <option label="Animations diverses" value="10">Animations diverses</option>
     <option label="Théâtre" value="11">Théâtre</option>
     <option label="Feu d'artifice" value="12">Feu d'artifice</option>
</select>


Quand je valide mon formulaire, je recharge ma page et je fais afficher le résultat de ma recherche/filtrage.
Jusque là tout marche bien sauf que mon select se remet à zéro Sad

Que dois-je écrire pour conserver le choix fait dans le select ?

J'espère que quelqu'un pourra m'aider.
Bonne journée
Isabelle
Back to top
View user's profile Send private message
Gowser
Smarty Pro


Joined: 19 Feb 2008
Posts: 104
Location: Nantes (France)

PostPosted: Wed Jan 20, 2010 9:12 am    Post subject: Reply with quote

Bonjour,

Avec un peu de retard Smile , voici la solution :

{html_options options=$agenda_types selected=$smarty.post.agd_type_id}


++
Back to top
View user's profile Send private message Send e-mail
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