Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to debug using firebug and show the value of radio button
    text
    copied!<p>I have radio buttons as shown below.</p> <pre><code> &lt;div id="lensType"&gt; &lt;input type="radio" name="design" style="vertical-align: middle" value="1"/&gt; &lt;label for="design"&gt;Single Vision&lt;/label&gt;&lt;br/&gt; &lt;input type="radio" name="design" style="vertical-align: middle" value="2" /&gt; &lt;label for="material" &gt;Accommodative Support&lt;/label&gt;&lt;br/&gt; &lt;input type="radio" name="design" style="vertical-align: middle" value="3"/&gt; &lt;label for="design"&gt;Bifocal&lt;/label&gt; &lt;br/&gt; &lt;input type="radio" name="design" style="vertical-align: middle" value="4" /&gt; &lt;label for="material" &gt;Varifocal (Intermediate/Near)&lt;/label&gt;&lt;br/&gt; &lt;input type="radio" name="design" style="vertical-align: middle" value="5"/&gt; &lt;label for="material" &gt;Varifocal (Distance/Near)&lt;/label&gt; &lt;/div&gt; </code></pre> <p>I am making a dynamic select. I have my javascript code that post the value . It seems the supplier value is now posted. Below is the code for my script.</p> <pre><code> $(document).ready(function(){ function populate() { fetch.doPost('getSupplier.php'); } $('#lensType').change(populate); var fetch = function() { var counties = $('#county'); return { doPost: function(src) { $('#loading_county_drop_down').show(); // Show the Loading... $('#county_drop_down').hide(); // Hide the drop down $('#no_county_drop_down').hide(); // Hide the "no counties" message (if it's the case) if (src) $.post(src, { supplier: $('#lensType').val() }, this.getSupplier); else throw new Error('No source was passed !'); }, getSupplier: function(results) { if (!results) return; counties.html(results); $('#loading_county_drop_down').hide(); // Hide the Loading... $('#county_drop_down').show(); // Show the drop down } } }(); populate(); }); </code></pre> <p>Php code :</p> <pre><code>&lt;?php if(isSet($_POST['supplier'])) { include 'db.php'; $stmt = $mysql-&gt;prepare("SELECT DISTINCT SupplierBrand FROM plastic WHERE HeadingNo='".$_POST['supplier']."'"); $stmt-&gt;execute(); $stmt-&gt;bind_result($supplierBrand); while ($row = $stmt-&gt;fetch()) : ?&gt; &lt;option value="&lt;?php echo $supplierBrand; ?&gt;" width="100px"&gt;&lt;?php echo $supplierBrand; ?&gt;&lt;/option&gt; </code></pre> <p>My problem is when I debug I notice there is no value passed to the php script and this makes the select empty. I have tried to trace or debug by having firebug output the console.log and failed in this regard. Please assist with this code which is meant to show a dynamic list from a radio button selection.</p>
 

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