Button for calculations

W

Wes H.

I have a data access page that I am wanting to add to my website. On
this page I want to put a button that when pushed will do some small
calculations (addition and subtraction) and then post these calculations
into a series of text boxes.

I setup a test html document so that I can try to figure out how to do
this (because I know nothing about html or java) and I can't get it to
put anything in the text box. I know that it is process the function
because I have it set up to give an alert to me, but that's it. I've
tried a couple of different things, but I know that it is just a syntax
error on my part (like I said before, don't know html). Here is the code
that I am using:

<html>

<head>
<script>
<!--

function calc()
{
dividend = 8;
divisor = 4;
myString = "The quotient is ";
quotient = dividend*divisor

alert(myString + quotient);

}

-->
</script>
<meta name="GENERATOR" content="Microsoft FrontPage 6.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 1</title>
</head>

<body>
<form method="POST">
<p><input type="text" name="T3" size="20" ></p>
</form>
<form method="POST">
<p><input type="button" onclick="calc();" value="Button" name="B3"></p>
</form>
</body>

</html>

If anyone can help me out with this last little bit that I am missing
then I would greatly appreciate it. Once I get that then I should be
good to go.

Thanks again,
Wes
 

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