PC Review


Reply
Thread Tools Rate Thread

how to sum two form field values and display it in another field

 
 
=?Utf-8?B?eW91c3NlZg==?=
Guest
Posts: n/a
 
      29th May 2007
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
 
Reply With Quote
 
 
 
 
David Berry
Guest
Posts: n/a
 
      29th May 2007
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/FrontPa...3/Default.aspx
-----------------------------------


"youssef" <(E-Mail Removed)> wrote in message
news:17DAA50F-124E-4F2E-BD87-(E-Mail Removed)...
> 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



 
Reply With Quote
 
Trevor Lawrence
Guest
Posts: n/a
 
      30th May 2007

"David Berry" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> 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


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Display/Hide a Form Control/Field Based On Another Field Value? PowerLifter1450@gmail.com Microsoft Access Forms 7 3rd Nov 2007 09:27 PM
Display/Hide a Form Control/Field Based On Another Field Value? PowerLifter1450@gmail.com Microsoft Access Form Coding 7 3rd Nov 2007 09:27 PM
Display values of a field in the Form =?Utf-8?B?c3RldmU=?= Microsoft Access Forms 1 22nd Sep 2007 04:29 PM
display memo field on a form based on the value of another field =?Utf-8?B?SmVycnkgaW4gdGhlIERlc2VydC4=?= Microsoft Access 2 14th Jun 2007 04:35 PM
Includetext field does not display form field bookmark =?Utf-8?B?VHJ1ZGll?= Microsoft Word Document Management 0 10th Nov 2005 03:02 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:26 PM.