title: Assign selected value to be the POST value
body: <p>I am trying to make a selected value to be the POST value in a shopping cart.</p>
  
  <p>The snippet is:</p>
  
  <pre><code>&lt;div class="extra-option"&gt;
    &lt;ul&gt;
      &lt;li&gt;&lt;span&gt;Size:&lt;/span&gt;&lt;/li&gt;
      &lt;? foreach ($product-&gt;extra_options as $option):
        $control_name = 'grouped_products[' . $product-&gt;id . '][product_extra_options]['.$option-&gt;option_key.']';
        $posted_options = post('grouped_products[' . $product-&gt;id . '][product_extra_options]', array());
        $is_checked = isset($posted_options[$option-&gt;option_key]);
      ?&gt;
      &lt;input name="&lt;?= $product-&gt;id ?&gt;"
        &lt;?= radio_state($is_checked) ?&gt; 
        id="extra_option_&lt;?= $option-&gt;id ?&gt;"
        value="&lt;?= $option-&gt;option_key ?&gt;"
      type="radio"/&gt;
      &lt;label for="extra_option_&lt;?= $option-&gt;id ?&gt;"&gt;&lt;?= h($option-&gt;description) ?&gt;:&lt;/label&gt;
      &lt;? endforeach ?&gt;
    &lt;/ul&gt;
    &lt;div class="clear"&gt;&lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>The AJAX Handler snippet is:</p>
  
  <pre><code>function on_addProductGroupToCart($controller) {
    foreach(post('grouped_products', array()) as $product_id =&gt; $product) {
      $_POST['product_cart_quantity'] = 1;
      $_POST['product_id'] = $product_id;
      $_POST['product_options'] = $product['product_options'];
      $_POST['product_extra_options'] = $product['product_extra_options'];
      $controller-&gt;exec_action_handler('shop:on_addToCart');
    }
  }
  </code></pre>
  
  <p>The $POST snippet that I know I will have to work with is </p>
  
  <pre><code>$_POST['product_extra_options'] = $product['product_extra_options'];
  </code></pre>
  
  <p>If left as is, than the error that I receive is: "<strong>Undefined index:  product_extra_options</strong>"</p>
  
  <p>So, how can I assign the POST variable to be the selected value?</p>
  
  <p>Thanks!!!</p>