Hello,
I have two pages:
- order.html
- results.php
order.html is simply a form with radio button options. Each option is assigned a name and value ($a, $b, $c, etc.)
For example:
Legend:
(*) = radio button selected
( ) = radio button not selected
Base Server:
(*) 1U P3-1Ghz, 256MB (2x128M😎 Server $100 // value=a
( ) 1U P3-1Ghz, 512MB (2x256M😎 Server $200 // value=b
( ) 1U P3-1Ghz, 1GB (2x512M😎 Server $300 // value=c
Add Memory:
(*) Add 256MB (2x128M😎 Server $10 // value=d
( ) Add 512MB (2x256M😎 Server $20 // value=e
( ) Add 1GB (2x512M😎 Server $30 // value=f
results.php does the variable calculation and adds the sum of selected options:
$subtotal = $a+$d
When the user selects his options and presses submit, results.php processes the request and displays the subtotal ($subtotal).
So far so good, everything calculates and displays perfectly on results.php
Now I would like to make it so whenever a user changes a selection, it automagically updates the subtotal on the same page (order.html) with or without pressing the submit button. The process would be similar to the javascript "onchange" funtion.
Can this be done in PHP?
Thanks,
-Rich