AJAX event returns same data always So, this is a simple form, and what the ajax call back does here is that it returns the value of a field that's being changed.

The problem is that, only the value of the first change is returned. If i change the value a second time, the returned value is the same as first. 
I'm not sure what is happening here, it needs a better pair of eyes.

Here's the code  

&lt;?php

    //Create raffle form
    function raffle_create_form($form, &amp;$form_state)
    {
        dpm($form_state);
        //Basic raffle info
        $form['raf_raffle_name'] = array(
            '#type' =&gt; "textfield",
            "#prefix" =&gt; "&lt;h5&gt;Raffle information&lt;/h5&gt;&lt;hr&gt;",
            "#title" =&gt; "Raffle Name:",
            "#required" =&gt; TRUE
        );

        $form['raf_allowed_number'] = array(
            '#type' =&gt; "textfield",
            "#title" =&gt; "Number of allowed members",
            "#required" =&gt; TRUE,
            '#element_validate' =&gt; array('element_validate_number')
        );

        $form['raf_start_now'] = array(
            "#type" =&gt; "checkbox",
            "#title" =&gt; "Start raffle now?"
        );

        $form['raf_end_date'] = array(
            "#type" =&gt; "date",
            "#title" =&gt; "When to close this raffle?",
            "#required" =&gt; TRUE
        );

        $form['raf_prize_type'] = array(
            '#type' =&gt; "select",
            "#options" =&gt; array('gift' =&gt; 'Steam Gift', 'hardware' =&gt; 'Gaming peripherals'),
            "#title" =&gt; "Prize type",
            "#required" =&gt; TRUE,
            "#ajax" =&gt; array(
                'callback' =&gt; 'raffle_create_form_type_steam',
                'wrapper' =&gt; 'steam_options',
                'event' =&gt; 'change',
                'method' =&gt; 'replace',
            ),
        );

        $form['raf_prize_name'] = array(
            '#type' =&gt; "textfield",
            "#title" =&gt; "Prize name",
            "#prefix" =&gt; "&lt;div id='steam_options'&gt;&lt;/div&gt;",
            "#required" =&gt; TRUE
        );

        $form['raf_prize_about'] = array(
            '#type' =&gt; "textarea",
            "#resizeable" =&gt; true,
            "#title" =&gt; "Prize description"
        );

        $form['raf_prize_thumb'] = array(
            '#type' =&gt; "file",
            "#title" =&gt; "Prize thumbnail"
        );

        $form['raf_prize_link'] = array(
            '#type' =&gt; 'textfield',
            '#title' =&gt; "Link to product"
        );

        $form['raf_raffle_create'] = array(
            '#type' =&gt; 'submit',
            '#value' =&gt; "Create Raffle",
        );

        $form['#submit'][] = 'raffle_create_form_submit';

        return $form;
    }

    function raffle_create_form_validate($form, &amp;$form_state)
    {
        dpm($form_state);
    }

    function raffle_create_form_submit($form, &amp;$form_state)
    {

    }

    function raffle_create_form_type_steam($form, &amp;$form_state)
    {
        return $form_state['values']['raf_prize_type'];
    }**
Whatever data is returned must be encapsulated in a div element of the same id as the wrapper.

This fixed the problem for me :)

function raffle_create_form_type_steam($form, &amp;$form_state)
{
    if($form_state['values']['raf_prize_type'] == 'hardware')
    {
        return "&lt;div id='steam_options'&gt;&lt;/div&gt;";
    }
    else
    {
        return  $form['raf_steam_option_game_append'] = array(
                '#type' =&gt; 'checkbox',
                '#title' =&gt; 'Check if Steamer has game in library',
                '#description' =&gt; 'Does not allow gamer to join raffle if said gift already exists within gamer\'s steam library',
                "#prefix" =&gt; "&lt;div id='steam_options'&gt;",
                "#suffix" =&gt; "&lt;/div&gt;"
            );
    }

}