Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <div class="form-group row">
- <label class="col-md-3 form-control-label">{l s='Subject'
- d='Shop.Forms.Labels'}</label>
- <div class="col-md-6">
- <select id="id_contact" name="id_contact"
- onchange="showElemFromSelect('id_contact', 'desc_contact')">
- <option value="0">{l s='Choisir...'}</option>
- {foreach from=$contact.contacts item=contact_elt}
- <option value="{$contact_elt.id_contact|intval}" {if
- isset($smarty.post.id_contact) && $smarty.post.id_contact == $contact_elt.id_contact}selected="selected" {/if}>{$contact_elt.name}</option>
- {/foreach}
- </select>
- </div>
- {foreach from=$contact.contacts item=contact_elt }
- <div id="desc_contact" style="display:none;">
- <p class="
- {$contact_elt.id_contact|intval}_desc_contact_p">
- {$contact_elt.description}
- </p>
- </div>
- {/foreach}
- </div>
- function showElemFromSelect(select_id, elem_id)
- {
- var select = document.getElementById(select_id);
- for (var i = 0; i < select.length; ++i)
- {
- var elem = document.getElementById(elem_id + select.options[i].value);
- if (elem != null)
- toggle(elem, i == select.selectedIndex);
- }
- }
Add Comment
Please, Sign In to add comment