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.

Reply
 
Thread Tools Search this Thread Display Modes
  #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
  #2  
Old 11-20-2006, 10:12 PM
DevilDog#1 is offline DevilDog#1

Join Date: Jul 2002
Posts: 7,040

Check THIS out please ...
__________________








Quote:
If I don't do that doesn't mean I can't - DD#1
Reply With Quote
  #3  
Old 11-20-2006, 10:54 PM
IcIshoot is offline IcIshoot

Join Date: Mar 2004
Location: Farmington Hills, MI
Posts: 1,473

Send a message via AIM to IcIshoot Send a message via MSN to IcIshoot Send a message via Yahoo to IcIshoot
firewall shouldn't be blocking that, since it runs on the client side.

if there isn't any errors, do you have javascript enabled in your browser?
Reply With Quote
  #4  
Old 11-21-2006, 04:06 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

its supposed to be enabled but aint shure, still getting used to this OS since i updated it just the other day to XP SP2.

where do i check this?
Reply With Quote
  #5  
Old 11-21-2006, 06:52 PM
DevilDog#1 is offline DevilDog#1

Join Date: Jul 2002
Posts: 7,040

Code below works

PHP Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!-- 
JavaScript calculator -->
<
HTML>
<
HEAD>
<
TITLE>K98Calculator</TITLE>

<
SCRIPT LANGUAGE="JavaScript">

function 
CalculateSum(AtextBtextform)
{
var 
parseFloat(Atext);
var 
parseFloat(Btext);
form.Answer.value = (B);
}

function 
ClearForm(form)
{
form.input_A.value "";
form.input_B.value "";
form.Answer.value "";
}

function 
SubtractSum(AtextBtextform)
{
var 
parseFloat(Atext);
var 
parseFloat(Btext);
form.Answer.value = (B);
}

function 
MultiplySum(AtextBtextform)
{
var 
parseFloat(Atext);
var 
parseFloat(Btext);
form.Answer.value = (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
__________________








Quote:
If I don't do that doesn't mean I can't - DD#1

Last edited by DevilDog#1; 11-21-2006 at 07:11 PM.
Reply With Quote
  #6  
Old 11-21-2006, 08:21 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

cool, still cant find the enable java on my browser
Reply With Quote
  #7  
Old 11-21-2006, 08:39 PM
DevilDog#1 is offline DevilDog#1

Join Date: Jul 2002
Posts: 7,040

What're you using? IE 6? IE7? FF?
__________________








Quote:
If I don't do that doesn't mean I can't - DD#1
Reply With Quote
  #8  
Old 11-22-2006, 01:23 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

im using version 6. IE
Reply With Quote
  #9  
Old 11-23-2006, 10:24 AM
SilentTrigger is offline SilentTrigger
-1PARA-

Join Date: Sep 2002
Location: Sweden
Posts: 3,972

Tools - Internet Options - Safty - Adapt levels and at the bottom of the list. You need to read behind the lines here as I have my Windows in Swedish.
__________________
-1PARA-AlexKall

My photography website



Reply With Quote
  #10  
Old 11-23-2006, 07:58 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

yup its enabled
Reply With Quote
Reply


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 11:49 PM.




Powered by vBulletin®