_selectAll('to_contacts') and _selectAll('cc_contacts') were raising:
"TypeError: Cannot read property 'length' of null"
Add missing <select> elements until the code is rewritten to take care of this
situation.
Signed-off-by: Nicolas Iooss <nicolas.iooss_git@polytechnique.org>
</tr>
{/if}
</table>
+ {if $contacts|@count eq 0}
+ {* Current Javascript code needs some elements to exist. *}
+ {* TODO: rewrite the code to accept non-existent elements without raising exceptions *}
+ <select id="to_contacts" name="to_contacts[]" multiple="multiple" style="display: none;">
+ <option value=""> </option>
+ </select>
+ <select id="cc_contacts" name="cc_contacts[]" multiple="multiple" style="display: none;">
+ <option value=""> </option>
+ </select>
+ <select id="contacts" name="all_contacts[]" multiple="multiple" style="display: none;">
+ <option value=""> </option>
+ </select>
+ {/if}
<fieldset>
<legend>Sujet : <input type='text' name='sujet' size='60' value="{$smarty.request.sujet}" /></legend>
<div class="center">