List through fieldName: illegal value I have created content type with field as List(text).
If I select any of above option and try to save it, it through "fieldName: illegal value" error.But if I modified option in below format and then try to save it. It get saved successfully.

-option1

-option2

-option3

-option4


Does list doesnot support first format? Is there any other way to resolve this without changing its format ?
You can achieve that by using hook_form_alter function.

I've tested the following code on my instance. It's working fine.

Use the following code in your custom module.

function YOUR_MODULE_form_alter(&amp;$form, &amp;$form_state, $form_id) {     
        if ($form['#form_id'] == 'YOUR-CONTENT-TYPE_node_form') {
         $form['YOUR-FILED-NAME']['und']['#options'] = array (
       'Group1' =&gt; array(
          1 =&gt; 'Option1',
          2 =&gt; 'Option2',

        ),
        'Group2' =&gt; array(
          3 =&gt; 'Option3',
          4 =&gt; 'Option4',
        ),
    );
    return $form;
        }
    }