#Ajax change the input wrapper i've made a form which update the price of a product. The user just need to select a duration by a select-list and it update the price by an Ajax callback. It update well the price but it change the structure of my select and then the select when is changed again does nothing...

The form inputs :

$key = array('field_friterie_suggest', 'MY-PRODUCT-SKU');

$form['content']['deals'][$key[0]]['purchase']['value'] = array(
            '#type' =&gt; 'select',
            '#name' =&gt; 'update-price-'.$key[0],
            '#options' =&gt; array(               
                5 =&gt; t('- None -'),
                0 =&gt; t('1 month'),
                1 =&gt; t('3 month'),
                2 =&gt; t('6 month'),
                3 =&gt; t('1 year'),
            ),
            '#default_value' =&gt; $default_purchase_value,
            '#ajax' =&gt; array(
                'callback' =&gt; 'fritr_commerce_update_pricing_callback',
                'wrapper' =&gt; 'pricing-'.$key[0],                
            ),
            '#attributes' =&gt; array(
                'data-update' =&gt; array(
                    'pricing-'.$key[0],  
                ),
                'data-type' =&gt; array(
                    $key[1],  
                ),
            ),
        );        
        $form['content']['deals'][$key[0]]['purchase']['pricing'] = array (
            '#prefix' =&gt; '&lt;div class="pricing" id="pricing-'.$key[0].'"&gt;',
            '#suffix' =&gt; '$&lt;/div&gt;',
            '#markup' =&gt; 0,
        ); 


And my callback :

$month = $form_state['triggering_element']['#value'];
    $price = 0;
    if ($mont != 5) {
        $month_definition = array(1,3,6,12);
        // get the product by his SKU
        $product = commerce_product_load_by_sku($form_state['triggering_element']['#attributes']['data-type'][0]);        
        // get the product price and reduction
        $product_base_price = ($product-&gt;commerce_price[LANGUAGE_NONE][0]['amount'] / 100) * $month_definition[$month];
        $reduction = $product-&gt;field_commerce_reductions[LANGUAGE_NONE][$month]['value'];        
        // set the new price
        $price = $product_base_price - ($product_base_price * ($reduction/100));                    
    }
    return array (
        '#prefix' =&gt; '&lt;div class="pricing" id="'.$form_state['triggering_element']['#attributes']['data-update'][0].'"&gt;',
        '#suffix' =&gt; '€&lt;/div&gt;',
        '#markup' =&gt; $price,
    );


So my input become :

&lt;select data-update="pricing-field_friterie_suggest" data-type="MY-PRODUCT-SKU" class="form-control form-select ajax-processed" id="edit-content-deals-field-friterie-suggest-purchase-value" name="update-price-field_friterie_suggest"&gt;&lt;/select&gt;


to :

&lt;div class="form-item form-item-update-price-field-friterie-suggest form-type-select form-group"&gt;
    &lt;div class="input-group"&gt;
        &lt;select data-update="pricing-field_friterie_suggest" data-type="MISE-EN-AVANT-SITE" class="form-control form-select ajax-processed" id="edit-content-deals-field-friterie-suggest-purchase-value" name="update-price-field_friterie_suggest"&gt;&lt;/select&gt;
        &lt;span class="input-group-addon"&gt;&lt;/span&gt;
    &lt;/div&gt;
&lt;/div&gt;


Then when i change the value of the select, it does nothing. Can you help me please ?
The solution proposed by Jaypan works well.
The solution was to not put the modifications of my field in the callback but in the form definition and set the value here by checking the $form_state fields.