Note that there are some explanatory texts on larger screens.

plurals
  1. POOnly one value from checkbox being sent in PHP mail
    primarykey
    data
    text
    <p>I am using a script that has a foreach loop and this shows the right amount of checkboxes depending on what is set in the admin area of Magento.</p> <p>The problem that I am facing is that there may be multiple checkboxes however only the checkbox that is selected nearest the top is the value that is sent with the form. I need all the checkbox values that have been selected to be sent. </p> <p>This is what I have in my mail script to get the checkboxes values <code>$check = $_POST['check'];</code></p> <p>And this is the code below that uses the foreach to show the right amount of checkboxes.</p> <pre><code> &lt;?php $SKU = "1282670_01"; $product = Mage::getModel('catalog/product')-&gt;loadByAttribute('sku',$SKU); if($product-&gt;getTypeId() == "configurable"){ $childs = $product-&gt;getTypeInstance()-&gt;getUsedProducts(); } $i = 0; foreach ($childs as $child) { ?&gt; &lt;?php $colour_name = $child-&gt;getAttributeText('real_colour'); ?&gt; &lt;li class="notranslate focused" id="fo143li2"&gt; &lt;fieldset&gt; &lt;div&gt; &lt;span&gt; &lt;img width="35" height="35" src="&lt;?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA) . 'catalog/product' . $child-&gt;getSwatch() ?&gt;"&gt; &lt;input type="checkbox" style="margin-top:-10px;" onchange="handleInput(this);" tabindex="5" value="&lt;?php echo $colour_name ?&gt;" class="field checkbox" name="check" id="&lt;?php echo $colour_name ?&gt;"&gt; &lt;label for="&lt;?php echo $colour_name ?&gt;" class="choice"&gt;&lt;/label&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload