I have tried but I can't do it.
I think you need code like this:
<html>
<head>
<script type="text/javascript">
function validate()
{x=document.myForm
x.total.value = +x.amount.value*x.cost.value}
</script>
</head>
<body>
<form name="myForm" action="" onsubmit="validate()">
Enter Amount:<input type="text" name="amount" size="20" value=""><br>
Enter Cost: <input type="text" name="cost" size="20" readonly=readonly
value= "2.00"><br>
Total Value: <input type="text" name="total" size="20" value=""><br>
<input type="submit" value="Submit">
</form>
</body>
</html>
But the problem is that neither the box "amount" nor "total" retain the
value. During the execution of the code, the values are there (as tested by
alerts) but on completion of the function, both boxes are blank.
I am confused.
I can't help you and I can't understand what is wrong.
Can someone help me too please.
--
Cheers,
Trevor L., WIP (Web Interested Person)
Website:
http://tandcl.homemail.com.au
Trevor L. wrote:
> Yes, you can do it, but in Javascript.
>
> It is not difficult, but I would need a bit of time to write and test
> it (about 10minutes) . I am off to shops now - here in Australia. If
> you are on the other side of the world (e.g.USA), I can probably
> answer while you are asleep.
>
> Not sure about the form to EMail bit. I have seen discussions on this
> but haven't tried it myself. (I am not a business peson, just an
> amateur web junkie)
> --
> Cheers,
> Trevor L., WIP (Web Interested Person)
> Website: http://tandcl.homemail.com.au
>
> Eric Willems wrote:
>> I want to add up data in a form but I don't know how to do that. For
>> example: if some wants to order 1 time product X and 2 times product
>> Y, I want to present a total price before the submit of the form. The
>> form/data will be presented in an E-mail to me. I use frontpage.
>>
>> Regards