Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Hey thanks for all the tips (special thanks to Loopo), this is how i have done it:</p> <p>i i.e. have 3 radio buttons &amp; 3 checkbox buttons :</p> <p>HTML:</p> <pre><code>&lt;input type="radio" name="example" value="one" id="one" checked /&gt;&lt;label for="studio"&gt;One&lt;/label&gt; &lt;input type="radio" name="example" value="two" id="two" /&gt;&lt;label for="two"&gt;Two&lt;/label&gt; &lt;input type="radio" name="example" value="three" id="three" /&gt;&lt;label for="three"&gt;Three&lt;/label&gt; &lt;input type="checkbox" name="ek" value="1" id="ek" /&gt;&lt;label for="ek"&gt;ek&lt;/label&gt; &lt;input type="checkbox" name="epc" value="1" id="epc" "/&gt;&lt;label for="epc"&gt;epc&lt;/label&gt; &lt;input type="checkbox" name="gk" value="1" id="gk" "/&gt;&lt;label for="gk"&gt;gk&lt;/label&gt; </code></pre> <p>PHP:</p> <pre><code>if ($_SERVER['REQUEST_METHOD'] == 'POST'){ $var = $_POST['example']; $value = 0; $discount = 0; if (!empty($_REQUEST['ek'])){ $value = 115; } if (!empty($_REQUEST['ek']) &amp;&amp; ($_REQUEST['epc'])){ $value = 125; } if (!empty($_REQUEST['epc']) &amp;&amp; ($building === 'one')){ $value += 115; } elseif (!empty($_REQUEST['epc']) &amp;&amp; ($building === 'two')){ $value += 165; $discount = 10; } elseif (!empty($_REQUEST['epc']) &amp;&amp; ($building === 'three')){ $value += 170; $discount = 10; } if (!empty($_REQUEST['gk'])){ $value += 130; } $total = $value - $discount; } </code></pre> <p>It is possible this is a long version,... But maybe it can help some people in the future!</p>
    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.
    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