An illegal choice has been detected when I submit my webform module
Editing webform-form-**.tpl or any template file is designed to alter the theme or display of the webform. It seems you are having issue with the forms content, specifically default values.

If you are using the Form API to create your form in your own module, you will need to declare it as described in the FAPI documentation.

&lt;?php
  $form['selected'] = array(
    '#type' =&gt; 'select',
    '#title' =&gt; t('Selected'),
    '#options' =&gt; array(
      0 =&gt; t('No'),
      1 =&gt; t('Yes'),
    ),
    '#default_value' =&gt; $category['selected'],
    '#description' =&gt; t('Set this to &lt;em&gt;Yes&lt;/em&gt; if you would like this category to be selected by default.'),
  );
?&gt;


The error that you are getting tends to occur when form elements are submitted that were not defined in the original form. And by the look of your template edit, that could easily be the case.

Check out your log at Administer > Logs > Recent log entries to see what is causing the error.

To get an empty entry submitted from the select options force the 'empty option' form declaration. Works like a treat.

'#empty_option'=&gt;t('- Select -'),


Good luck.
xK