/    Sign up×
Community /Pin to ProfileBookmark

Need custom script

Hello,

I need a custom script to be made. Is this the right place to request? I am willing to pay.

I would like a script to perform the following action:

Step 1: 1 HOUR x ONE worker’s hourly salary = $_____ lost today. [Calculate answer]

Step 2: 5 days a week x $_____ lost today = $_____ lost this week. [Calculate answer]

Step 3: 48 weeks x $_____ lost this week = $_____ lost this year. [Calculate answer]

Step 4: Number of employees x $_____ lost this year = $_____ total! [Calculate answer]

Is it possible to have Step 1 calculated, then Step 2 brings forward (or keeps displayed) Step 1s calculation and so on? Or any better way to accomplish the above.

Thanks,
MonaE

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@AdamBrillJan 20.2004 — Is this close to what you wanted?<html>
<head>
<title>Untitled</title>
<script type="text/javascript">
salary = 7.5; //price per hour
num_employees = 5; //number of employees
function calculate(){
form = document.form1;
form.today.value = salary*8;
form.today2.value = form.today.value;
form.week.value = form.today.value*5;
form.week2.value = form.week.value;
form.year.value = form.week.value*48;
form.year2.value = form.year.value;
form.total.value = form.year.value*num_employees;
}
</script>
</head>

<body onload="calculate();">

<form name="form1">
Step 1: 8 HOUR x salary(<script type="text/javascript">document.write(salary);</script>) = $<input type="text" name="today"> lost today.<br>
<br>
Step 2: 5 days a week x $<input type="text" name="today2"> lost today = $<input type="text" name="week">lost this week.<br>
<br>
Step 3: 48 weeks x $<input type="text" name="week2"> lost this week = $<input type="text" name="year">lost this year.<br>
<br>
Step 4: Number of employees(<script type="text/javascript">document.write(num_employees);</script>) x $<input type="text" name="year2"> lost this year = $<input type="text" name="total"> total!
</form>

</body>
</html>
×

Success!

Help @MonaE spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.25,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...