|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
isavdz Smarty n00b
Joined: 01 Sep 2009 Posts: 2
|
Posted: Tue Sep 01, 2009 1:16 pm Post subject: Utilisation de {html_options} |
|
|
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 & Ateliers" value="7">Stages & 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
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 |
|
Gowser Smarty Pro
Joined: 19 Feb 2008 Posts: 104 Location: Nantes (France)
|
Posted: Wed Jan 20, 2010 9:12 am Post subject: |
|
|
Bonjour,
Avec un peu de retard , voici la solution :
{html_options options=$agenda_types selected=$smarty.post.agd_type_id}
++ |
|
Back to top |
|
|
|
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
|