How can I get Frontpage to ad? (calculating)




Mark Fitzpatrick

FrontPage (and other similar programs) don't do this themselves. You need to
use JavaScript to do this. It's not too tricky, but does involve a bit of
work. You can start at and to
look for similar scripts that could get you started.



Trevor Lawrence

tomas mathiassen said:
I'm making a little page were I need the page to calculate. How can I do

Try this

<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.*/

Sum of Two Numbers
<form name="form1" action="">
Number 1:<br />
<input type="text" id="number1" value="" size="40" /><br/>
Number 2:<br />
<input type="text" id="number2" value="" size="40" /><br/>
Sum:<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 "/>


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question