Drupal 7 Forms API radios value not saving to the $form_state array after submitting I have a form where I am using radio buttons and when I use integers as the index, the form is saving and passing the value just fine. However if I use a string as the index it is saving nothing in the $form_state['storage']['values'].

Example - This works as expected:

$testArray = array(0 =&gt; 'test1', 1 =&gt; 'test2', 2 =&gt; 'test3');

$form['step0']['testthis'] = array (
    '#type' =&gt; 'radios',
    '#options' =&gt; $testArray
);


After submitting this example the $form_state will look like (with array index 2 selected):

- Form Storage -
Array
(
    [values] =&gt; Array
        (
            [step0] =&gt; Array
                (
                    [testthis] =&gt; 2
                )

        )

)


Example - This does not work as expected... for me!

$testArray = array('test01' =&gt; 'test1', 'test02' =&gt; 'test2', 'test03' =&gt; 'test3');

$form['step0']['testthis'] = array (
    '#type' =&gt; 'radios',
    '#options' =&gt; $testArray
);


After submitting this example the $form_state will look like (with array index test03 selected):

- Form Storage -
Array
(
    [values] =&gt; Array
        (
            [step0] =&gt; Array
                (
                    [testthis] =&gt;
                )

        )

)


I expect it to output

- Form Storage -
Array
(
    [values] =&gt; Array
        (
            [step0] =&gt; Array
                (
                    [testthis] =&gt; test03
                )

        )

)


Any insight would be most appreciated!

Thank you.

Edit: I forgot to mention that the HTML element is output just fine. So using the string index the element looks like:

&lt;input type="radio" id="edit-step0-testthis-test3" name="step0[testthis]" value="test03" class="form-radio"&gt;
My mistake!

I am using AJAX to submit the form and selecting the radio button using the .attr() function.

I was using an improper name in the element selector thus nothing was technically being selected.

Hope that helps someone else!