PC Review
Forums
Newsgroups
Microsoft Word
Microsoft Frontpage
how to sum two form field values and display it in another field
Forums
Newsgroups
Microsoft Word
Microsoft Frontpage
how to sum two form field values and display it in another field
![]() |
how to sum two form field values and display it in another field |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
how to sum two form field values and display the result in another field
within the same form and pass it to another page as a hidden value |
|
|
|
#2 |
|
Guest
Posts: n/a
|
You can use JavaScript to do this. See the free scripts at
http://javascript.internet.com under Math or Forms -- David Berry Microsoft MVP - FrontPage FrontPage Support: http://www.frontpagemvps.com/ ----------------------------------- To assist you in getting the best answers for FrontPage support see: http://www.frontpagemvps.com/FrontP...53/Default.aspx ----------------------------------- "youssef" <youssef@discussions.microsoft.com> wrote in message news:17DAA50F-124E-4F2E-BD87-6EE68AC00675@microsoft.com... > how to sum two form field values and display the result in another field > within the same form and pass it to another page as a hidden value |
|
|
|
#3 |
|
Guest
Posts: n/a
|
"David Berry" <dberry@mvps.org> wrote in message news:%23c9RYGhoHHA.4960@TK2MSFTNGP02.phx.gbl... > You can use JavaScript to do this. See the free scripts at > http://javascript.internet.com under Math or Forms Example: <html> <head> <script type="text/javascript"> function calcform() { with (document.form1) { result.value = +number1.value + +number2.value}} /*Note the extra + operator before each value. This is needed to convert the value from a string to a number.*/ </script> </head> <body> <form name="form1" action=""> Number 1 (enter number):<br /> <input type="text" id="number1" value="" size="40" /><br/> Number 2 (enter value in dollars, e.g. 2.50) :<br /> <input type="text" id="number2" value="" size="40" /><br/> Result:<br /> <input type="text" id="result" value="" size="40" /><br/> <input type="button" id="Calculate" value="Calculate" onclick="calcform()" /> <input type="reset" id="reset" value=" Clear "/> </form> </body> </html> Passing the value to another page is another matter. If you need help to do this I can post the code for how I do it - it does need some more JavaScript -- Trevor Lawrence Canberra Microsoft MVP - FrontPage MVP Web Site http://trevorl.mvps.org |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 

