|
Web design and Programming Discuss website creation and other programming topics. |
|
Thread Tools | Search this Thread | Display Modes |
#1
|
||
|
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. |
#3
|
||
|
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? |
#4
|
||
|
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? |
#5
|
||
|
Code below works
PHP Code:
Last edited by DevilDog#1; 11-21-2006 at 07:11 PM. |
#6
|
||
|
cool, still cant find the enable java on my browser
|
#7
|
||
|
What're you using? IE 6? IE7? FF?
|
#8
|
||
|
im using version 6. IE
|
#9
|
||
|
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.
|
#10
|
||
|
yup its enabled
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|