rbudj
asked on
Auto Calculation Solution
I have a form where some values are pulled from a database, but I will use a static form for example.
I have a form where I need to choose a value from a dropdown and have calculations performed and populate a hidden field.
<form id="form1 name="form1" method="" action="">
<select name="service">
<option>10</option>
<option>20</option>
<option>30</option>
</select>
<input type="text" name="totalHours" />
<input type="hidden" name="totalCost" />
</form>
My form is more complex but I should be able to build once I get started.
Example: If I choose 10 from the select menu and then enter 1.5 in the totalHours textbox, I need the page to automatically populate the hidden field with the 10 x 1.5 hours. I am not sure the best way to approach this. My pages are .php.
Any solutions?
I have a form where I need to choose a value from a dropdown and have calculations performed and populate a hidden field.
<form id="form1 name="form1" method="" action="">
<select name="service">
<option>10</option>
<option>20</option>
<option>30</option>
</select>
<input type="text" name="totalHours" />
<input type="hidden" name="totalCost" />
</form>
My form is more complex but I should be able to build once I get started.
Example: If I choose 10 from the select menu and then enter 1.5 in the totalHours textbox, I need the page to automatically populate the hidden field with the 10 x 1.5 hours. I am not sure the best way to approach this. My pages are .php.
Any solutions?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
you need to do this either throw java script or ajax. and I recommend java script in your case.