automatically executes calculation
Posted: Mon Dec 01, 2008 2:56 pm
how to execute logical function without clicking button.
For example html form, where visitor can enter two numbers. Then click button - calculate and php script does calculation
Html code something like this
<form method = "POST" action = "'.$_SERVER['PHP_SELF'].'">
<input type="text" name="first_number" size="5">
<input type="text" name="second_number" size="5">
<input type="submit" name="doit" value="calculate">
</form>
then php script to calculate, for example $first_number+$second_number
But how to do calculation automaticaly? without this <input type="submit" name="doit" value="calculate">
Visitor enters numbers and calculation is shown automatically, depending entered numbers...
For example html form, where visitor can enter two numbers. Then click button - calculate and php script does calculation
Html code something like this
<form method = "POST" action = "'.$_SERVER['PHP_SELF'].'">
<input type="text" name="first_number" size="5">
<input type="text" name="second_number" size="5">
<input type="submit" name="doit" value="calculate">
</form>
then php script to calculate, for example $first_number+$second_number
But how to do calculation automaticaly? without this <input type="submit" name="doit" value="calculate">
Visitor enters numbers and calculation is shown automatically, depending entered numbers...