Order Form

M

Mezzo Anna

Is there any way to create a calculated field in Frontpage 2000? I have an
order form that I'd like to include the amount due based on quantity x unit
price, and then have a total. Any help would be appreciated!
 
T

Trevor L.

Mezzo said:
Is there any way to create a calculated field in Frontpage 2000? I
have an order form that I'd like to include the amount due based on
quantity x unit price, and then have a total. Any help would be
appreciated!

This code will do a calculation. Just paste it into the HTML view of
FrontPage.

Amend the function to do what you want, e.g.
Addition
result.value = (+val1.value) + (+val2.value)
OR Multiplication
result.value = (+val1.value) * (+val2.value)

<html>
<head>
<script type="text/javascript">
function sendform()
{
with (document.form1)
{ result.value = (+val1.value) / (+val2.value) }
// other stuff here
}
</script>
</head>
<body>

<form name="form1" action="">
<table>
<tr>
<td>Dollar value: </td>
<td><input type="text" id="val1" value="10"/></td>
</tr>
<tr>
<td>Divide by: </td>
<td><input type="text" id="val2" value="3" /></td>
</tr>
<tr>
<td>Result of Division: </td>
<td><input type="text" id="result" size="20" /></td>
</tr>
</table>
<input type="button" id="submit" value=" Send "onclick="sendform()" />
</form>

</body>
</html>
 

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

Top