Go Back   Novahq.net Forum > Computers > Web design and Programming
FAQ Community Calendar Today's Posts Search

Web design and Programming Discuss website creation and other programming topics.

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 11-20-2006, 09:49 PM
Mauser 98K is offline Mauser 98K
Mauser 98K's Avatar
Registered User

Join Date: Sep 2004
Location: New state of Amerika
Posts: 2,668

ok this is where this belongs.

need some help getting this to work online, might be the firewall of server preventing this from working.

still cant get it to accept multiplycation and division, any sugestions.

<!-- JavaScript calculator -->
<HTML>
<HEAD>
<TITLE>K98Calculator</TITLE>

<SCRIPT LANGUAGE="JavaScript">

function CalculateSum(Atext, Btext, form)
{
var A = parseFloat(Atext);
var B = parseFloat(Btext);
form.Answer.value = A + B;
}
function ClearForm(form)
{
form.input_A.value = "";
form.input_B.value = "";
form.Answer.value = "";
}
function SubtractSum(Atext, Btext, form)
{
var A = parseFloat(Atext);
var B = parseFloat(Btext);
form.Answer.value = A - B;
}
function SubtractSum(Atext, Btext, form)
{
var A = parseFloat(Atext);
var B = parseFloat(Btext);
form.Answer.value = A x B;
}


// end of JavaScript functions -->
</SCRIPT>
</HEAD>

<BODY>

<P><FONT SIZE="+2">MAUSER CALCULATOR</FONT></P>

<FORM NAME="Calculator" METHOD="post">
<P>Enter a number: <INPUT TYPE=TEXT NAME="input_A" SIZE=40></P>
<P>Enter a number: <INPUT TYPE=TEXT NAME="input_B" SIZE=40></P>
<P><INPUT TYPE="button" VALUE="Add Numbers" name="AddButton" onClick="CalculateSum(this.form.input_A.value, this.form.input_B.value, this.form)"></P>
<P><INPUT TYPE="button" VALUE="Subtract Numbers" name="SubtractButton" onClick="SubtractSum(this.form.input_A.value, this.form.input_B.value, this.form)"></P>
<P><INPUT TYPE="button" VALUE="Multiply Numbers" name="MultiplyButton" onClick="MultiplySum(this.form.input_A.value, this.form.input_B.value, this.form)"></P>

<P><INPUT TYPE="button" VALUE="Clear Fields" name="ClearButton" onClick="ClearForm(this.form)"></P>
<P>Answer = <INPUT TYPE=TEXT NAME="Answer" SIZE=45></P>
</FORM>

</BODY>
</HTML>

Last edited by Mauser 98K; 11-20-2006 at 09:56 PM.
Reply With Quote
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

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

Forum Jump


All times are GMT -5. The time now is 10:32 AM.




Powered by vBulletin®