How to change number values in PHP when radio button is check or click
<p>I have 4 rows in a table.</p>

<p>Each row has 4 radio buttons.</p>

<p>Each radio buttons has value number [1, 2, 3, 4]</p>

<p>When user selects one of the radio buttons, it automatically prints the value in each row. Then I take each value and total them at the bottom of the table.</p>

<p>I'm guessing it can be done with javascript? But how?</p>

<p>Here's a sample PHP code for the row:</p>

<pre><code>&lt;input type="radio" name="a" value="1" &lt;?php if($row['a'] == '1'){echo "checked";} ?&gt;/&gt;
</code></pre>

<p>I want to print out the value at the end of each row. Then total the each row's value at the bottom of the table.</p>

<p>Also, here's my php code to total all rows.</p>

<blockquote>
  <p>

<pre><code>                                  $total = $a + $b + $c + $d;

                                  echo $total;
                              ?&gt;
</code></pre>
</blockquote>

<p>Thanks! :)</p>
