...

View Full Version : Newbie at javascript



I2izzo
02-29-2012, 04:55 PM
I am very new to JavaScript and am trying to create a page that calculate net annual pay and pops up an alert box that states what they will take home as well as pay in taxes. I have figured my way out of created the boxes to enter fields and even got a calculate button. I cannot figure out the code the actually calculate the taxes!

Field one is for first name and referenced by id: num1
Field two is for last name and referenced by id: num2
Field three is enter gross salary with id: num3

I am using 20% for federal taxes and 10% for state taxes and need it to show up in an alert box... Any ideas? Thanks!

Philip M
02-29-2012, 05:26 PM
Show your code. We will not do your homework for you, but if you make a substantial effort yourself then doubtless someone will help you correct/improve it.

Do please read the posting guidelines regarding silly thread titles. The thread title is supposed to help people who have a similar problem in future. Yours is useless for this purpose. You can (and should) edit it to make it more meaningful.


It is your responsibility to die() if necessary….. - PHP Manual

I2izzo
02-29-2012, 06:23 PM
<form action="" method="post" name="math_form">
<p> Enter your First Name:
<input name="num1" type="text" id="num1" size="10" maxlength="10">
</p>

<p> Enter your Last Name:
<input name="num2" type="text" id="num2" size="10" maxlength="10">
</p>

<p> Enter your gross salary:
<input name="num3" type="text" id="num3" size="10" maxlength="10">
</p>


<FORM>

Click this button to calulate your annual net pay!
<INPUT NAME="calc" VALUE="Calculate" TYPE=BUTTON
onClick=temp(this.form)>
<p>

</FORM>

Philip M
02-29-2012, 07:06 PM
And your Javascript? Once again - we will not do your homework for you, but if you make a substantial effort yourself then doubtless someone will help you correct/improve it. See forum rule #1.5.

You have two <form> tags. Where is the result of your calculation to appear?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum